text
stringlengths
14
5.77M
meta
dict
__index_level_0__
int64
0
9.97k
Q: Why is `*(multi + row)` producing a pointer address instead of a value? Why is *(multi + row) producing a pointer address instead of a value? Im confused but there must be a good explanation, but i dont know still. #include <stdio.h> #define ROWS 5 #define COLS 10 int multi[ROWS][COLS]; int main(void) { int row, col; for (row = 0; row < ROWS; row++) { for (col = 0; col < COLS; col++) { multi[row][col] = row*col; } } for (row = 0; row < ROWS; row++) { for (col = 0; col < COLS; col++) { printf("\n%d ",multi[row][col]); printf("%d ",*(*(multi + row) + col)); } } return 0; } A: It doesn't. multi is a two-dimensional array, so dereferencing the pointer which it decays into when you perform pointer arithmetic on it results in an array (which is COLS elements wide). Steps: * *int multi[ROWS][COLS]; - here multi is a two-dimensional array. *multi + row - here multi decayed into a pointer of type int (*)[COLS] **(multi + row) - this is equivalent with multi[row], i. e. the type of this expression is int[COLS]. A: Because multi is a 2D array which evaluates to a block pointer. *(*(multi + row)); should get you a value. *(multi + row); evaluates to a pointer to the row whose index is determined by 'row' Update: A block pointer still contains an address like other pointers, but it's arithmetic operates on blocks instead of single elements e.g. a pointer to first row of an array. If you increment it, it would skip one row of array (rather than one element as in case of a normal pointer). A: multi has a type of the form "array of arrays", so in most contexts, it decays to a type of the form "pointer to array". After adding row, it still has "pointer to array" type, but possibly points to an array other than the first array (first row) in multi. Now, applying the * operator to "pointer to array" results in an array type, which again decays to a pointer to its initial element. This pointer has type "pointer to int". A: Because it's a two-dimensional array, you have two levels of indirection to go through before getting to the value. A: multi is an array of integer array i.e int (multi[rows])[cols]. multi can decay to a pointer to integer array. so multi can decay to int (*multi)[cols]. so when you do multi+rows you are doing this essentially sizeof(int [cols]) + sizeof(int[cols])...`row` times and when you dereference it you get a element of type array of ints i.e the address of the first element of the integer array that you got in multi+row. now add offset to this dereferenced pointer and then dereference again, you will get the element i.e *(multi+row) /*call this x*/-->gives an element of type int[] and int[] can decay to int*. *(x+cols) --> gives you the element.
{ "redpajama_set_name": "RedPajamaStackExchange" }
9,168
\section{Introduction} Matrix\footnote{\url{https://matrix.org/}, \url{https:/matrix.org/spec/}} is a specification of protocols and their behavior for a middleware that provides communication and data services for decentralized applications. While the size of its public federation is still comparatively small, its utilization rises quickly, and several organizations are deploying large, private federations. Currently, Matrix is mainly used as the basis of a decentralized instant messaging protocol employed by the French government, the Mozilla foundation, the Federal Defense Forces of Germany, and others. Matrix implements topic-based publish-subscribe services based on a federated architecture. Similar to e-mail or XMPP, clients attach themselves to a Matrix server, their so-called homeserver, which represents them in the Matrix network. Servers with clients subscribed to a specific topic (called room in Matrix parlance) form a federation to exchange published events independent of other topics. Events can be either communication events or state update events on the stored data. In the instant messaging use case, topics are employed for group or one-to-one communication rooms, communication events are used for instant messages, while the stored data is used for persistent information like room membership or room description. In contrast to e-mail or XMPP, Matrix replaces pure message passing with a replicated, per-topic data structure that stores the causal history of events. As Matrix servers can thereby synchronize their room's full causal histories, the Matrix approach promises increased decentralized system resilience: After a network partition, a server has significantly stronger means to recover the complete state of the room, i.e., to avoid loss of events. While this increased level of system resilience has been observed by practitioners, the underlying replicated data type has not yet been analyzed thoroughly. \glsunset{MEG} In this paper, we first extract and abstract the \acrlong{MEG} replicated data type from the Matrix specification and denote it by \gls{MEG}. A \gls{MEG} is a \gls{DAG} made up of vertices which represent communication and data storage update events, and directed edges which stand for potential causal relations between events. Because the graph represents the potential causal order of events, a correct graph is inherently cycle-free. Appending new events is the only write operation supported by the Matrix Event Graph, which makes it append-only --- and a candidate for Distributed Ledger Technologies. Thus, the \gls{MEG} can be considered as a fundamental concept for various applications that are based on causal histories, ranging from decentralized crowdsensing databases in Internet of Things scenarios over decentralized collaboration applications to decentralized push notification systems. Since, for Distributed Ledger Technologies, it has been conjectured that consistency, decentralization, and scalability cannot be achieved simultaneously~\cite{Zhang2018, Raikwar2020}, our analysis focuses on these aspects. As main contribution we therefore provide an analysis of the degree to which the \gls{MEG} fulfills consistency, deployability in decentralized scenarios, and scalability: {\bfseries Consistency:} In accordance with the CAP theorem~\cite{gilbert-lynch-cap-proof}, and since Matrix provides availability and partition tolerance, the \gls{MEG} necessarily has to sacrifice strong consistency. We show that Matrix provides Strong Eventual Consistency by proving that the \gls{MEG} is a \gls{CRDT}~\cite{shapiro-crdt} for causal histories. {\bfseries Decentralization:} We discuss the implications of byzantine attackers on the specific type of \gls{CRDT} that the \gls{MEG} represents. The avoidance of consensus is the primary reason that allows the \gls{MEG} \gls{CRDT} to facilitate $n > f$ environments with $n$ total participants of which $f$ exhibit byzantine faults. {\bfseries Scalability:} The inherent probabilism of uncoordinated, concurrent updates on a \gls{MEG} is the main challeng for the analysis of the \gls{MEG} with respect to scalability. We are interested in the width of the \gls{MEG} in terms of the number of forward extremities, i.e. `vertices without children', over time. We study the width of the \gls{MEG} using a formalization by means of Markov chains. We observe that the \gls{MEG} does not degenerate, and conjecture that this non-degeneracy is inherent to the underlying spatially inhomogeneous random walk. This paper is structured as follows: We start with a more detailed description of how the \gls{MEG} works and the problem statement in \cref{sec:mx_event_graph}. \cref{sec:background} presents related work and background on replicated data types. Assumptions and architecture are given in \cref{sec:system-model}. The inner working of the \gls{MEG} is formalized in \cref{sec:mx-crdt}, which is then used to prove that it is a Conflict-Free Replicated Data Type. In \cref{sec:weakening-assumptions}, we perform a reality check of the utilized assumptions of \cref{sec:mx-crdt} and discuss how the \gls{MEG} can be made byzantine fault tolerant. \cref{sec:convergence} formalizes the stochastic behavior of the width of the \gls{MEG} and provides evidence that the width always evolves to a near-optimal value, and does so fast. We conclude the paper in \cref{sec:conclusion}. \begin{figure}[htbp] \resizebox{0.85\linewidth}{!}{ \includegraphics{assets/ex-meg-wom.pdf} } \caption{Basic example of a \gls{MEG}} \label{fig:event_graph} \end{figure} \section{MEG: Overview and Problem Statement} \label{sec:mx_event_graph} In the following and for illustration purposes, we often make use of the instant messaging use case of Matrix, but we want to emphasize that the \acrlong{MEG} is a general replicated data type for append-only causal histories of publish-subscribe events. We also typically focus our studies on a single \gls{MEG} instance, and therefore a single broadcast domain associated with that \gls{MEG}. However, several independent \glspl{MEG} can coexist. A sample \gls{MEG} is exhibited in \cref{fig:event_graph}. {\bfseries General \gls{MEG} setup.} As mentioned before, a \gls{MEG} is a \acrfull{DAG}. One \gls{MEG} represents the message history and attributes of a group or 1:1 chat, and it is replicated independently by all participating servers. Upon creation, the \gls{DAG} consists of only a single vertex, the \emph{root vertex}. Each vertex in the \gls{DAG} corresponds to an application-defined publish-subscribe event, e.g., to a text message or temperature reading. Edges represent potential causal relationships between events: When a new vertex is added, it is appended to the existing \gls{DAG} through one or more outgoing edges. These edges point towards vertices that had no incoming edges before, i.e., the newest events in causal history, which we from now on call the \emph{forward extremities} of the DAG. The selection of forward extremities is done according to the current knowledge of the adding replica. This potential causal relationship is known as the \emph{happened before} relationship\footnote{Note that \citeauthor{Lamport1978} defines $a$ \emph{happened before} $b$ as $a \rightarrow b$. In this paper, we actually use the converse relation $b \rightarrow a$, as common for Distributed Ledger Technologies, so that new references can be stored as part of the new vertex, and old vertices can be kept immutable. It follows that for $b \rightarrow a$, we say $a$ is the parent of $b$. }, as defined by Lamport~\cite{Lamport1978}: For $a \leftarrow b$, we say $a$ happened before $b$. Edges thereby form a partial order that is consistent with the causal order in which events took place. In addition to being directed, acyclic, and representing the causal order of events, the \gls{MEG} is also weakly connected since all newly added vertices have at least one outgoing edge. The root vertex, as the only vertex without outgoing edges, is therefore the unique minimal element of the partial order represented by the \gls{DAG}. DAGs with this specific structure are called \emph{rooted}~\cite{Platt2000}. {\bfseries Adding a new vertex to the source replica.} The replica that creates an event on behalf of a client and appends it as a vertex is called \emph{source replica}. When it adds a vertex, the corresponding event could be causally related to previous events. Thus, all forward extremities should be included as edges. Replicas can experience a high number of forward extremities caused by latencies or partitions, and malicious replicas could forge events with a high number of parents. However, certain algorithms executed on the \gls{MEG} do not scale well with the number of parent events, i.e., they can become very resource intensive, especially when old parts of the \gls{MEG} are referenced as parents~\cite{synapse-issue-forward-extremities-accumulate}. In practice, the maximum number of parent events therefore has to be restricted to a finite value $d$. If there are more than $d$ forward extremities, a replica selects a subset of size $d$ for the new event. For the potential causal order relation in the \gls{MEG} still to be consistent with the actual causal order, clients have to inform the replica about actual causal dependencies so that those are included as parents. {\bfseries Updating all replicas.} Beyond appending the new vertex to the local \gls{DAG}, the source replica also needs to synchronize with the other replicas. The replica sends a \gls{DAG} update that consists of the new vertex and edges to all replicas using a broadcast protocol. On reception of an update, replicas append the new vertex to their \gls{DAG} via the new edges selected by the source replica as soon as all required parent vertices exist in the local replica. In case the parent vertices are not (yet) available, the update is buffered until they are. {\bfseries Dealing with concurrent updates.} When clients at two different replicas concurrently invoke updates, each replica thinks of their vertex as the single next step in causal history represented by their \glspl{DAG}, i.e., both deviate from the last consistent \gls{DAG} state. In case of continuous synchronization failure, e.g. due to a network partition, additional client updates will enlarge the inconsistency between the replicas' DAGs and lead to two causally independent chains of events, built from the last synchronized event. Both replicas will continue to try to synchronize their state with other replicas. When the partition heals, all replicas will eventually receive all updates. As depicted in \cref{fig:event_graph}, instead of trying to find a linear order of updates and to solve conflicts with rollbacks, the concurrent DAG states are merged by attaching both causally independent chains of events to the last synchronized event, i.e., by forking the DAG. This acceptance of concurrency in the data type itself by only providing a partial order on events is the core idea of the Matrix Event Graph. It is also the basis for our proof of conflict-freedom in \cref{sec:mx-crdt}. A fork in the DAG introduced by concurrency will lead to two causally independent forward extremities. Following the attachment rules for new vertices, a replica that has received and appended both causally independent chains to its DAG selects both as parents for a new vertex. In terms of graphs, this means that the new vertex will join both chains again, which marks that the period of concurrency and causal independence is over, and reduces the number of forward extremities by one. {\bfseries Problem statement.} The way in which concurrency is handled in a \gls{MEG} as well as the use of various parameters as outlined above give rise to the key research questions addressed in this paper: Which consistency guarantees can application developers expect from a \gls{MEG} --- and under which assumptions do they hold? And: Can the width of the \gls{MEG} degenerate? The preceding explanations describe how the \gls{MEG} is available under partition, and how it tries to achieve Eventual Consistency, as conjectured by the Matrix developers~\cite{matrix-spec-architecture}. In this paper, we provide a proof of Strong Eventual Consistency in \cref{sec:mx-crdt}. In \cref{sec:weakening-assumptions}, we relax the employed assumptions, particularly on the communication primitive. In addition, the overview above showed that if the number of vertex parents is restricted to $d$ and selected randomly, the evolution of the number of forward extremities $u$, i.e., the width of the DAG, is non-trivial in concurrent environments. In \cref{sec:convergence}, we explore whether for arbitrary start values of $u$, if $k$ replicas continuously select $d$ parents independently and then synchronize the new vertices, the width of the DAG converges in a sufficiently small number of iterations. In addition, we explore how the choice of the number of parent vertices $d$ affects the speed of convergence. {\bfseries Not in scope of this paper:} While we make assumptions on and deal with the underlying broadcast communication primitive, we consider the topic of broadcast communication per se beyond the scope of this paper. Moreover, Matrix employs an access control system for \glspl{MEG}, which we will not consider further, but which has been examined in \cite{matrix-decomposition}. \section{Related Work \& Background} \label{sec:background} \glsreset{CRDT} \citeauthor*{glimpseofthematrix} investigated quantitative aspects of the public Matrix federation, and found scalability problems with the broadcast communication currently employed by Matrix~\cite{glimpseofthematrix}. However, they did not investigate the scalability and other properties of the replicated data structure itself. The access control system of Matrix, which builds on top of the \gls{MEG}, was very recently studied in \cite{matrix-decomposition}. Privacy and usability aspects of Matrix, along with a \acrshort{CRDT}-based vision on how to improve this situation in federated networks in general, are the topic of~\cite{auvolat2019}. In the field of replicated data types, \citeauthor*{shapiro-crdt} introduced the category of \glspl{CRDT}, together with a new consistency model provided by the category, namely Strong Eventual Consistency~\cite{shapiro-crdt}. Following the initial definition, new papers mostly focused on implementations of the data type like the JSON-CRDT by \citeauthor*{kleppmann-json-crdt} ~\cite{kleppmann-json-crdt}, or extended the base concept of \glspl{CRDT}~\cite{DePorre2019}. The initial \gls{CRDT} concept was overhauled in cooperation with the original authors in~\cite{Preguica2019}. We will mainly use the new \gls{CRDT} terminology introduced there. \subsection{Consistency Models} \label{subsec:consistency} The inherent trade-off between \emph{Consistency} and \emph{Availability} in the presence of network partitions in distributed systems led to the definition of a variety of consistency models. A well-known consistency model is \emph{Eventual Consistency} (EC), which provides the following guarantees~\cite{shapiro-crdt}: \begin{itemize} \item \emph{Eventual Delivery:} An update applied by one correct replica is eventually applied by every correct replica. \item \emph{Termination:} Every invoked method terminates. \item \emph{Convergence:} Correct replicas that applied the same set of updates eventually reach equivalent states. \end{itemize} \emph{\gls{SEC}} builds on top of EC, and strengthens Convergence~\cite{shapiro-crdt}: \begin{itemize} \item \emph{Strong Convergence:} Correct replicas that applied the same set of updates have equivalent states. \end{itemize} Whether two states are equivalent is application-dependent. In our case, the state of two replicas is equivalent if their graphs consist of identical vertices and edges. Note that "the same \emph{set} of updates" means that while the updates are identical, they might be received or applied in different order. The key difference between Convergence and Strong Convergence is that with Convergence, replicas may coordinate with other replicas to find agreement on their state even after having applied updates. Especially if the ordering of updates matters, this can lead to rollbacks. With Strong Convergence, the agreement has to be immanent and implicit. \subsection{Conflict-Free Replicated Data Types} \label{subsec:crdt} \glsreset{CRDT} \glspl{CRDT} were first formalized in~\cite{shapiro-crdt}. \glspl{CRDT} are an abstract data structure that allows for optimistic update execution (cf.~\cite{Saito2005}) while guaranteeing conflict-freedom upon network synchronization. The system model of \glspl{CRDT} is based on a \emph{fail-silent} abstraction with a Causal Order Reliable Broadcast communication protocol (see \cref{sec:system-model}). For objects that implement a \gls{CRDT} in a system with $n$ replicas, \citeauthor*{shapiro-crdt} show that \gls{SEC} is ensured for up to $n-1$ replica failures~\cite{shapiro-crdt}. Two conceptually different, but equally expressive types of \glspl{CRDT} are the \emph{operation-based} and the \emph{state-based} \gls{CRDT}. Replicas implement functions to be invoked by clients to access or modify the state. The key difference between operation- and state-based \glspl{CRDT} lies in the way of synchronization: In state-based \glspl{CRDT}, all replicas periodically send their full state to all other replicas which then merge states. In contrast, operation-based \glspl{CRDT} only synchronize upon changes. Source replicas transmit state changes resulting from a client invocation as operations. In \cref{sec:mx-crdt}, we show that the \gls{MEG} is an operation-based \gls{CRDT}. Operation-based \glspl{CRDT} implement functions that can be classified as \texttt{update} or \texttt{query}. A \texttt{query} function returns information on the current state of the replica. Their counterpart, \texttt{update} functions, modify the state. They comprise two steps: At first, a \texttt{generator}\footnote{Originally introduced as \emph{prepare-update}} step is executed by the source replica. It is side-effect-free, but returns an \emph{operation}, i.\,e., an encapsulation of the state changes. A common example of a \texttt{generator} step is the creation of a unique object identifier for \texttt{update} functions that add an object to the state. The second step is called \texttt{effector}\footnote{Originally introduced as \emph{effect-update}} step, it must be executed at every replica. Thus, the source replica transmits the generated operation to all replicas using broadcast. Upon reception of an operation, each replica executes the \texttt{effector} step locally and applies the resulting changes to their state.~\cite{Preguica2011} In general, the data structure of a \gls{CRDT} cannot maintain a specific shape or topology, such as a \gls{DAG}, as concurrent updates could violate invariants. Specific implementations of \glspl{CRDT} can overcome this restriction however, for example shown by the \emph{Operation-based Add-only monotonic \gls{DAG}} described in~\cite{Shapiro2011}. Their implementation allows clients to collaboratively edit a DAG, by adding vertices and edges in separate updates. Topology preservation is enforced by rejection of new edges that violate the current partial order of the \gls{DAG}. In a similar vein, the \gls{MEG} is designed in a way that preserves its topology as rooted \gls{DAG} inherently, which we will show in \cref{subsec:preserve_dag}. \section{Assumptions and Architecture} \label{sec:system-model} We assume a finite and known set of replicas, each storing a full local copy of the \gls{MEG}. {\bfseries Assumptions.} We make use of two failure models, both based on the \emph{asynchronous} timing assumption, which means that no upper bounds on computation or network transmission times are given. The \emph{fail-silent} model~\cite[p. 63]{Cachin2011} implies that faulty replicas can crash-stop at any time, while the remaining replicas have no means to reliably distinguish failure from communication or processing delays, i.e., the fault is `silent'. The \emph{fail-silent-arbitrary} model~\cite[p. 64]{Cachin2011} allows for arbitrary, i.e. byzantine, behavior of faulty replicas. This includes intentionally malicious behavior. In this model, `silent' also means that replicas cannot detect whether another replica currently adheres to the protocol or not. We call a replica \emph{correct} if it is non-faulty. A fault is the failure to adhere to the protocol. Additionally, in the fail-silent model, a replica is also considered faulty if it is crashing infinitely often, remains crashed forever or looses its memory upon recovery.~\cite{Cachin2011} The formal CRDT-proof that we give in \cref{sec:mx-crdt} is based on the stricter assumption of a \emph{fail-silent} model. In \cref{sec:weakening-assumptions} we extend the claims to the \emph{fail-silent-arbitrary} model. Furthermore, we make use of two broadcast abstractions in this work. Firstly, we use \emph{Reliable Broadcast}. Informally, this abstraction provides a set of properties that guarantee that eventually, the same set of messages is received by all correct replicas, even if the sending replica fails~\cite{Cachin2011}. \begin{itemize} \item \emph{Validity:} If a correct replica sends a message $m$, then it eventually receives $m$. \item \emph{No duplication:} Messages are received only once. \item \emph{No creation:} If a replica receives a message $m$ with sender $p$, then $m$ was previously sent by $p$. \item \emph{Agreement:} If a message $m$ is received by some correct replica, $m$ is eventually received by every correct replica. \end{itemize} The other, more powerful, abstraction is called \emph{Causal Order Reliable Broadcast}. It extends the guarantees of Reliable Broadcast by also preserving the \emph{causal order} of messages~\cite{Cachin2011}: \begin{itemize} \item \emph{Causal Delivery:} For any message $m_1$ and $m_2$ where the broadcast of message $m_1$ \emph{happened before} (cf.~\cite{Lamport1978}) the broadcast of message $m_2$, $m_2$ is only received by replicas that have already received $m_1$. \end{itemize} The formal CRDT-proof in \cref{sec:mx-crdt} is based on the \emph{Causal Order Reliable Broadcast} abstraction. In \cref{sec:weakening-assumptions} we relax this assumption to \emph{Reliable Broadcast} --- even in byzantine scenarios --- while maintaining the \gls{CRDT} properties. {\bfseries Architecture.} As we can see in \cref{fig:sys_model}, each \emph{client} is attached to a single \emph{replica} in which it trusts. The client can request functions of class \texttt{query} or \texttt{update} at their replica, as defined in \cref{subsec:crdt}. As part of executing an \texttt{update} function, the source replica distributes operations, i.e., encoded state changes, to all replicas using a broadcast \emph{communication abstraction}. \begin{figure} \resizebox{0.95\linewidth}{!}{ \includegraphics[]{assets/high_level_view.pdf}} \caption{An update request by a client invokes the generator of an update function at the replica, which creates an update operation. This update operation is then transmitted to all replicas, including the calling replica itself, through the communication abstraction. The communication abstraction enforces guarantees about incoming operations, e.g. on their ordering. } \label{fig:sys_model} \end{figure} \begin{figure} \resizebox{0.95\linewidth}{!}{ \includegraphics[]{assets/inner_view.pdf}} \caption{Inner workings of the source replica and communication abstraction when receiving an update request. After entering the replica through the Reference Monitor, it is passed to the \gls{CRDT}. The \gls{CRDT} encodes the state changes as an operation which is then broadcasted to all replicas using the communication abstraction. Incoming update operations, again, pass the Reference Monitor before being processed at the \gls{CRDT} component. The \gls{CRDT} then applies them to the local state of the replica. } \label{fig:inner_view} \end{figure} A more granular architectural view is provided in \cref{fig:inner_view}. Inside a replica, the \emph{Reference Monitor} is the entry point for incoming requests from clients and operations from remote replicas. It serves as a gate keeper to prevent further processing of operations or requests that violate the protocol or, in a byzantine setting, originate from unauthorized or unauthenticated parties. Operations and requests that pass the Reference Monitor are handed to the \emph{\gls{CRDT}}. The \gls{CRDT} can read and modify the state of the replica and is thus the core logic module of the replica. In case of a \texttt{query} request, it accesses the state and returns the desired value. For \texttt{update} requests, the generator of the update function encapsulates state changes into an operation that is passed to the communication abstraction. The \gls{CRDT} then returns to the client to indicate success. The communication abstraction sends the update operation to all replicas, including the calling replica itself.\footnote{While, depending on the specific communication abstraction, this is not required in an actual implementation, it is important on a conceptual level to ensure that the guarantees hold.} These update operations then trigger the local update effector which applies the changes to the state of the replica. \section{The MEG as CRDT} \label{sec:mx-crdt} Building upon the overview given in \cref{sec:mx_event_graph}, we formalize the \gls{MEG} as an operation-based shared object. We show that the \gls{MEG} is a \gls{CRDT} and thereby provides \acrfull{SEC}. The underlying assumption for this section is a fail-silent model with Causal Order Reliable Broadcast. This is in accordance with the assumptions used by \citeauthor*{Preguica2011} for \glspl{CRDT} (cf.~\cref{subsec:crdt})~\cite{Preguica2011}. \subsection{Formalization of the MEG} \label{subsec:formalization} To define the Matrix Event Graph as a \gls{CRDT}, we adopt the formal definition introduced with the concept of operation-based \glspl{CRDT} in~\cite{Preguica2011, shapiro-crdt} and use the pseudo code notation by \citeauthor*{Preguica2018}~\cite{Preguica2018}. An object is formally defined as $(S, s^0, q, t, u, P)$: $S$ is the space of possible per-replica states, and $s^0 \in S$ is the \texttt{initial} state of every replica. $q$ is the set of \texttt{query} functions. \texttt{update} functions are composed of a \texttt{generator} step $t$ and an \texttt{effector} step $u$. The \texttt{effector} $u$ may contain a \emph{delivery precondition} $P$, which must be fulfilled before an operation is being processed further. Notably, $P$ only delays the execution, it does not abort the \texttt{effector} step. When a replica with \texttt{state} $s \in S$ executes a step $u$, we denote this as $s \bullet u$, which yields a new \texttt{state}. As shorthand for the \texttt{state} at replica $i$, we write $s_i \in S$. We provide a pseudo code implementation of the \gls{MEG} as an operation-based \gls{CRDT} in \cref{lst:pseudocode}. A vertex is a tuple $(e, w)$ that represents an event in the \gls{MEG}. $w$ is a unique identifier for the event, whereas $e$ contains the actual event. Edges represent a potential causal relationship between child and parent vertex. The \texttt{state} is a \gls{DAG}, defined through a set of vertices and a set of edges. Initially ($s^0$), it consists of a single vertex and no edges. The \texttt{query} functions \texttt{lookup}, \texttt{hasChild}, \texttt{getExtremities} and \texttt{getState} allow to access the replica state without modification. \texttt{lookup} checks whether a vertex with a given identifier is part of the current state. Similarly, \texttt{hasChild} checks for the existence of child vertices for a given vertex. \texttt{getExtremities} returns the current set of forward extremities, whereas \texttt{getState} returns the \texttt{state}. The \texttt{update} function \texttt{add} is used to append new events to the \gls{MEG}. Its \texttt{generator} step $t_{add}$ takes the event $e$ as input argument. Based on the \texttt{state} of the source replica at that time, a set $L$ of forward extremities is created. Lastly, a unique identifier $w$ is chosen. The parameters $w$, $e$ and $L$, and a reference to the update function \texttt{add} are returned together an constitute the update operation. The \texttt{effector} $u_{add}$ is invoked by the operation that was created in the \texttt{generator} step. Once the delivery precondition $P$ is fulfilled, the new vertex $(e,w)$ and the new edges $((e,w),(e_p, w_p))$ for each $(e_p, w_p) \in L$ are added to the \texttt{state}, i.e., the set of vertices and edges, respectively. Since \texttt{add} is the only update function, we will drop it as a subscript for the steps $t$ and $u$ from now on. \begin{lstlisting}[mathescape={true}, float, caption={Pseudo code implementation of the Matrix CRDT. \texttt{query} and \texttt{update} indicate the type of the respective functions, \texttt{generator} and \texttt{effector} denote the two steps of an \texttt{update} function. \texttt{pre} is the delivery precondition $P$.}, label={lst:pseudocode}] state set $S=(V, E)$ // vertices $\color{gray}V$ consist of event $\color{gray}e$ and uid $\color{gray}w$: $\color{gray}(e,w)$, $\color{gray}E$ are edges: $\color{gray}E \subseteq V \times V$ initial $(\{(e_0, w_0)\}, \emptyset)$ query lookup (uid $w$) : boolean return $\exists ((e', w') \in V) : w' == w$ query hasChild (vertex $(e, w)$) : boolean return $\exists ((e', w') \in V) : ((e', w'), (e, w)) \in E$ query getExtremities () : list of vertices return $L=\textstyle\bigcup_{(e,w)\in V : \text{ not hasChild(}(e,w)\text{)}} \{(e,w)\}$ query getState () : set return $S$ update add generator (event $e$) let $L =$ getExtremities() let $w =$ unique() return add, ($e, L, w$) effector (event $e$, list of vertices $L$, uid $w$) pre: $\forall (e_p, w_p) \in L$: lookup($w_p$) $V = V \cup \{(e,w)\}$ $E = E \cup \textstyle\bigcup_{(e_p, w_p) \in L} \{((e,w), (e_p, w_p))\}$ \end{lstlisting} \subsection{Preservation of the DAG topology} \label{subsec:preserve_dag} As mentioned in \cref{subsec:crdt}, the preservation of a specific shape, such as a \gls{DAG}, is not possible in a generic way for \glspl{CRDT}. We now show that the \gls{MEG} always preserves the desired data structure of a rooted \gls{DAG} by design as \cref{lm:dag-property}. \begin{lemma} \label{lm:atleastoneedge} There is at least one forward extremity at any time after initialization of the \gls{MEG}. \end{lemma} \begin{proof} By induction.\\ \emph{Base case:} After initialization of the \gls{MEG}, the \gls{DAG} consists of a single root and no edges. Therefore, the root is a forward extremity as it has no incoming edges.\\ \emph{Induction step:} Given a valid \gls{MEG}, executing \texttt{add} appends a new vertex with only outgoing edges. Thus, that new vertex is a forward extremity. \end{proof} \begin{lemma} \label{lm:dag-property} The \gls{MEG} maintains the properties of a rooted DAG at all times: (i) single root, (ii) acyclicity, and (iii) weak connectedness. \end{lemma} \begin{proof} By induction. \\ \emph{Base case:} The initial state $s^0$ contains a single vertex and no edges. This \gls{MEG} therefore is a rooted DAG.\\ \emph{Induction step:} Given replicas $i$ with state $s_i=(V_i,E_i)$, where $s_i$ is a rooted DAG, an arbitrary source replica $r$ is selected. As part of the \texttt{generator} step $t$, the set of forward extremities is determined as $L$, and a unique identifier $w$ created. By \cref{lm:atleastoneedge}, $|L|>0$. Since $t$ is side-effect-free, the \gls{MEG} remains unchanged. Consequently, the execution of the \texttt{effector} step $u$ is triggered at each replica $i$. $u$ awaits the fulfillment of the delivery precondition $P$, which ensures that $s_i$ contains all parents that are referenced by $L$. Finally, applying $u$ yields the new replica states $s_i'$: \begin{align*} s_i'= (V_i \cup \{(e,w)\}, E_i \textstyle\bigcup_{(e_p, w_p) \in L} \{(e,w), (e_p,w_p))\}). \end{align*} Since all new edges are outgoing from the new vertex $(e,w)$, no new cycles can be formed, and existing roots remain roots. No new roots or isolated vertices have been added as the new vertex has outgoing edges. Because all $s_i$ were assumed to be rooted \glspl{DAG}, all $s_i'$ must be rooted \glspl{DAG}. \end{proof} \subsection{Proof of CRDT properties} \label{subsec:crdt_proof} Now, we show that \gls{MEG} implements an operation-based \gls{CRDT} and thus guarantees \gls{SEC}. We structure the proof by the \gls{SEC} properties Strong Convergence, Eventual Delivery, and Termination (cf. \cref{subsec:consistency}). {\bfseries Strong Convergence.} For Strong Convergence, we need to show commutativity of concurrent updates and causal order reception of operations for noncommutative updates. Commutativity for updates is determined by the commutativity of their operations. Two updates ($t, u$) and ($t', u'$) commute, iff for any reachable state $s \in S$ for which the delivery precondition $P$ is satisfied for both $u$ and $u'$: (i) $P$ is still satisfied for $u$ in $s \bullet u'$, and (ii) $s \bullet u \bullet u' \equiv s \bullet u' \bullet u$.~\cite{shapiro-crdt} \begin{lemma}\label{lm:P_remains} Once an update operation satisfies $P$ for some state $s$, it will continue to satisfy $P$ for any state $s'$ following $s$. \end{lemma} \begin{proof} Consider any update operation $u(e,L,w)$ that satisfies $P$ in some state $s=(V,E)$. Applying an arbitrary operation $u(e',L',w')$ to $s$ yields a new state $s'$: \begin{align*} s' &= s \bullet u(e', L', w') \\ &= (V \cup \{(e',w')\}, E \cup \textstyle\bigcup_{(e_p, w_p) \in L'}\{(e', w'), (e_p, w_p)\}) \end{align*} $P$ being satisfied in $s$ implies that it remains satisfied for $s'$: \begin{align*} &\forall (e_p,w_p) \in L : (e_p, w_p) \in V \\ \Rightarrow &\forall (e_p,w_p) \in L : (e_p, w_p) \in V \cup \{(e',w')\} \end{align*} \end{proof} \begin{lemma}\label{lm:crdt-com} Any two operations $u(e_i, L_i, w_i)$ and $u(e_j, L_j, w_j)$ commute with each other. \end{lemma} \begin{proof} We consider any state $s=(V,E)$ and two update operations $u(e_i, L_i, w_i)$, $u(e_j, L_j, w_j)$ that both satisfy $P$ in $s$. As shown in \cref{lm:P_remains}, after applying one operation, the other operation still satisfies $P$. It remains to show that the resulting states are equivalent, regardless of the order in which the effectors are executed. Since $u$ only performs a union of the edge and vertex sets, by commutativity of the union operator, commutativity of $u$ follows: $s \bullet u(e_i, L_i, w_i) \bullet u(e_j, L_j, w_j) \equiv s \bullet u(e_j, L_j, w_j) \bullet u(e_i, L_i, w_i)$ \end{proof} As we have shown, \gls{MEG} updates are commutative and Strong Convergence is guaranteed. This is possible because all required properties of the \gls{MEG} are preserved by design (cf.~\cref{lm:dag-property}). Since the \gls{MEG} encodes causal relations as edges in the data structure, the delivery precondition $P$ can ensure that these dependencies are respected without sacrificing commutativity. {\bfseries Eventual Delivery.} For Eventual Delivery, we need to show that $P$ is eventually satisfied for all operations. \begin{lemma}\label{lm:P_satisfied} $P$ is immediately satisfied on causally ordered message reception. \end{lemma} \begin{proof} $P$ ensures that all referenced parents are part of the local \texttt{state}. Since \texttt{getExtremities} selects all parents from the current \texttt{state}, $P$ must be satisfied at the source replica after the \texttt{generator} step. Once satisfied, $P$ remains satisfied since vertices are never removed. Therefore, receiving all causally preceding operations is sufficient to satisfy $P$ at every replica. Consequently, having causal order message reception, $P$ is immediately satisfied on reception. \end{proof} {\bfseries Termination.} Given the implementation in \cref{lst:pseudocode}, we can see that there are no loops or recursive calls in either of the functions, therefore, they will eventually exit. Knowing that $P$ is immediately satisfied given causal order message reception, as shown in \cref{lm:P_satisfied}, we can conclude that Termination holds. {\bfseries Conclusion.} We have shown Termination and eventual satisfaction of $P$. \cref{lm:crdt-com} shows commutativity of concurrent updates. Therefore, all properties of an operation-based \gls{CRDT} are met by the \gls{MEG}. \section{Relaxation of Assumptions and Reality Check for Byzantine Settings} \label{sec:weakening-assumptions} In this section, we evaluate the assumptions we have used for the \gls{CRDT} proof of the \gls{MEG} in \cref{sec:mx-crdt} and relax them wherever possible without violating previously shown guarantees. We show that Matrix currently provides no \gls{SEC} because of its unreliable broadcast protocol. However, when having a Reliable Broadcast abstraction that provides Validity and Agreement, the \gls{MEG} can provide \gls{SEC} in byzantine $n > f$ environments with $n$ total and $f$ faulty participants. This is possible since conflicts, created by byzantine replicas that share different update operations with different replicas, can always be resolved. \subsection{Relaxation of the Broadcast Assumptions} \label{subsec:weak_comm} In \cref{sec:mx-crdt}, we assumed a Causal Order Reliable Broadcast abstraction, which is commonly used with \glspl{CRDT}. Yet in reality, the communication abstraction employed by Matrix provides much weaker guarantees. We thus revisit the assumptions and show that the Causal Delivery property of the broadcast abstraction is not necessary\footnote{The No Duplication property is also not necessary: Because each vertex has a unique identifier $w$, and outgoing edges cannot be added afterwards, it suffices to make the effector conditional on the presence of the vertex in the replica state to gain idempotent effectors that can cope with multiple receptions of identical operations.} and can be removed without violating Strong Convergence for safety as well as Eventual Delivery and Termination for liveness (cf. \cref{sec:background} for definition and \cref{sec:mx-crdt} for fulfillment). {\bfseries Strong Convergence.} To provide Strong Convergence, replicas must receive noncommutative update operations in their causal order. As every update operation commutes with every other, as shown in \cref{lm:crdt-com}, Strong Convergence does not require any ordering guarantees by the communication abstraction. {\bfseries Eventual Delivery.} In \cref{lm:P_satisfied}, we used the Causal Delivery property to show that the delivery precondition $P$ is immediately satisfied. However, Eventual Delivery only requires that correct update operations received by a replica \emph{eventually} satisfy $P$, so that they can eventually be applied. It therefore remains to show that the delivery precondition $P$ is eventually satisfied without Causal Delivery. Given an update operation, $P$ is satisfied if all referenced parents are part of the \texttt{state} of a replica. If an operation satisfies $P$ at some point in time, it continues to satisfy $P$ thereafter, because the \gls{MEG} is an append-only data structure. As per \cref{lm:P_satisfied}, $P$ is satisfied for any given operation after the \texttt{generator} step at the source replica finishes. Therefore, all referenced parents must have been previously added to the \texttt{state} and therefore be part of some update operation. If an update operation does not satisfy $P$ at some replica due to reordering of operations by the broadcast abstraction, replicas can delay and buffer the update operation until $P$ is satisfied. Owing to the Validity and Agreement properties of the broadcast abstraction (cf. \cref{sec:system-model}), all missing update operations are eventually received by all correct replicas. As correct replicas apply all operations that they received and that satisfy $P$, all parents must eventually be part of their \texttt{state}. Consequently, for correct replicas, $P$ must eventually be satisfied for every update operation. {\bfseries Termination.} Since all method executions terminate, and since we have shown that in the new setting, $P$ is eventually satisfied for all operations, the Termination property still holds. Thus, the \gls{MEG} only requires a weak form of Reliable Broadcast, and does not depend on Causal Delivery. \subsection{Tolerating Byzantine Failures} \label{subsec:byzantine} In the following, we replace the \emph{fail-silent} failure model with the \emph{fail-silent-arbitrary} model. We assume that the adversary cannot permanently block broadcast communication between two correct replicas. In a system with $n$ replicas, the adversary can induce byzantine faults in up to $f$ replicas with $n > f$. This means that a client's trusted replica might be the only correct replica in the system. As the \gls{MEG} does not strive for consensus, it is able to cope with such a hostile environment. To model the capabilities of byzantine replicas in a distributed systems that implement a \gls{CRDT}, \citeauthor*{Zhao2016} introduce a three-part threat model~\cite{Zhao2016} which consists of attacks on the membership service, malicious updates, and attacks on the Reliable Broadcast service. To keep focus on the \gls{MEG}, we will only touch on the issues related to the membership service and malicious updates, and put the attack on the Reliable Broadcast service at the center of attention. {\bfseries Membership service.} With respect to a membership service, we assume a known set of replicas that does not change. Still, we want to note that attacks on the membership service for dynamic groups may prevent replicas from receiving some or all update operations, which could affect Eventual Delivery. We consider this as an important, but somewhat separate topic. {\bfseries Malicious updates.} Malicious replicas could attempt to inject updates into the data structure that are not compliant with the protocol. In general, to address threats from malicious updates, the Reference Monitor is the endpoint for all external interfaces of the replica. It ensures authorization, authentication, integrity, and general protocol compliance of incoming operations. Update operations that pass the Reference Monitor can therefore be handled like non-byzantine, i.e., correct operations. A serious attack could be based on non-unique event identifiers. However, unique event identifiers can be ensured in a byzantine environment by generating event identifiers from the event data using a collision-resistant hash function. This way, Reference Monitors can verify whether an event identifier is valid by recomputing the hash themselves. To prevent the injection of unauthorized update operations, impersonation needs to be prevented as well. This can be achieved by means of asymmetric encryption, i.e., by cryptographically signing update operations and a Public Key Infrastructure that is trusted by all correct replicas. Signatures also ensure integrity of update operations, so that update operations that are not directly received from the source replica cannot be altered unobtrusively. Therefore, authenticated update operations allow us to drop the No Creation property of the broadcast abstraction, as the Reference Monitor can now identify forged or tampered update operations itself. The creation of operations that are not protocol compliant, such as events with non-existing or non-(con)current extremities as parents, might incur load on performance, but does not threaten the correct operation of the \gls{MEG}. {\bfseries Attacks on the Reliable Broadcast Abstraction.} Attacks on the Reliable Broadcast abstraction may lead to correct replicas that receive different operations, potentially causing permanent divergence in replica states. While fail-silent-arbitrary Reliable Broadcast algorithms exist (cf.~\cite[p. 121]{Cachin2011}), they are generally difficult to scale to many replicas, as communication complexity increases in the number of replicas. However, we do not require all of their properties due to the commutative and conflict-free nature of the \gls{MEG}. Using asymmetric encryption, the No Creation property is not required and the broadcast abstraction is left to provide Validity and Agreement. As Validity is only concerned with correct sending replicas, faulty replicas can mainly attack Agreement by performing equivocation, i.e. broadcasting different update operations to different replica subsets, or not broadcasting an update operation to all replicas~\cite{non-equivocation}. We show that equivocation, a costly problem in fail-arbitrary Reliable Broadcast algorithms, is not an issue for the Matrix Event Graph due to its distinct structure. We recall that for Agreement, an operation that is received by some correct replica eventually has to be received by every correct replica. Under the assumption that malicious replicas have no means to fabricate a hash collision, they can only send operations with different event identifiers when trying to create inconsistencies. However, due to the conflict-free nature of an operation-based \gls{CRDT}, both operations can be received and processed by correct replicas. A byzantine replica that performs equivocation can therefore be modeled as two replicas that crash while sending independent update operations. Therefore, the broadcast abstraction only has to ensure that eventually, \emph{any} operation received at some correct replica will be received at every correct replica. In Matrix, Validity is provided since source replicas immediately apply update operations to their local state. However, with respect to Agreement, Matrix replicas use a `best-effort broadcast' that is implemented via unicast transmissions to all replicas. This alone does not provide Agreement even in fail-silent systems without byzantine attackers, as a failing replica could only provide a limited number of correct replicas with the update operation. To mitigate this issue, Matrix uses a backfilling mechanism which allows replicas to specifically request missing operations from other replicas. It is used when a replica receives an update operation for which the parents are not part of the replica state. With this mechanism, Matrix achieves Agreement under the assumption of constant \gls{MEG} progress, i.e., a never-ending stream of (arbitrary low-frequent) new update operations from other replicas. However, if / for as long as the progress come to a halt, Agreement, and thus Eventual Delivery, is violated\footnote{In the Matrix reference replica implementation Synapse, this issue has been raised in the developer community~\cite{githubdelivery}. Correct replicas will now take note of unreachable homeservers and retry synchronization once they become available eventually~\cite{githubcatchup}. Faulty senders still require constant progress. }. Therefore, Matrix does only provide Agreement and thereby \gls{SEC} under the assumption of constant progress. One could now replace the best-effort broadcast with a gossip-based broadcast protocol that is scalable and robust, as suggested in~\cite{glimpseofthematrix}. While this alone is not sufficient to ensure Agreement without constant progress, the efficient gossip-based broadcast could be used by replicas to periodically broadcast their current set of forward extremities to all other replicas, which then could trigger backfilling. This addition would guarantee probabilistic Agreement, and therefore \gls{SEC} for the \gls{MEG} implementation of Matrix. \section{Scalability: Width of the MEG over Time} \label{sec:convergence} In this section, we study the evolution of the width of the \gls{MEG} over time. While we verified our results with Monte-Carlo simulations, we decided to go for an analytical approach to deliver a precise mathematical problem definition and treatment. In Sections \ref{sec:mx-crdt} and \ref{sec:weakening-assumptions}, we assumed that \textit{all} forward extremities known to a replica are used as parents for new vertices created by the replica. In this case, the number of forward extremities is reduced as much as possible whenever a new vertex is created. However, as noted in \cref{sec:mx_event_graph}, honest replicas can experience a high number of forward extremities after a partition, and malicious replicas could deliberately create events with a high number of parents. This is problematic from a performance perspective because checks, particularly of the Reference Monitor, are resource intensive, especially when old parts of the \gls{MEG} are referenced, but are needed for every parent~\cite{synapse-issue-forward-extremities-accumulate}. Thus, for reasons of performance, the number of parents of a new vertex is restricted to a finite value $d$ in practice. If there are more than $d$ forward extremities, a replica selects a random subset of parents of size $d$ for the new vertex. In this section, we provide evidence that the width of the \gls{MEG} still converges\footnote{Please note that when we discuss convergence in this section, convergence is related to the number of forward extremities. In the previous CRDT-related section, convergence is related to propagation of states.} to the the number $k$ of participating replica times a small factor when all $k$ replica repeatedly and concurrently add a new vertex. We model the evolution of the width of the \gls{MEG} as follows. We assume that vertices are added in rounds. A round consists of two steps: First, each of the $k$ replicas concurrently adds a new forward extremity and thereby `eliminates' $d$ forward extremities which are used as parents. Second, all replicas synchronize their new extremities and reach a consistent state. The overall number of eliminated extremities depends on the amount of \textit{overlap} between the parent choices of different replicas. As we are interested in scaling $k$ while keeping $d$ low, we assume $k$ > $d$. As forward extremities cannot be eliminated effectively if a new forward extremity has only one parent, we assume $d > 1$. The model also accepts an arbitrarily high number of forward extremities $u_0$ as starting condition. We analyze the sequence of number of forward extremities $u_i$ by a mean value analysis. Please note that this model maximizes uncoordinated concurrency in Step 1 and, thus, models a worst case scenario: More new vertices per replica in Step 1, i.e., a higher frequency of updates by clients or prolonged periods of network partition, would eliminate more than $d$ overlap-free forward extremities, but not add additional ones. Also, if replicas would be aware of the eliminations of other replicas, their forward extremity choices could be done more overlap-free. \subsection{Stochastic Process}\label{subsec:stochastic_process} We represent the concurrent updates in Step 1 of each round as a stochastic urn model. The initial number of forward extremities $u$ is described by $u$ initial red balls, while the number of newly linked parent vertices $d$ is the number of balls taken out during a drawing by a replica. The update generator execution of the $k$ replicas lead to the conduction of $k$ independent drawings that can be modeled by sequential drawings with the use of black balls: the balls drawn by a replica are replaced by black balls and put back to the urn. Therefore, after $k$ replicas have performed Step 1, the black balls indicate the number of selected parent vertices. After each round, the black balls are replaced by red ones again and the next round starts with the current number of red balls. We let the random variable $R_{d,k}(u)$ denote the total number of removed forward extremities, while $u - R_{d,k}(u)$ denotes the number of forward extremities that `survived' for the subsequent urn experiment. With this urn experiment, we build a stochastic process for the behavior of the number of forward extremities. We derive the expectation and the variance of $R_{d,k}(u)$, and we provide a recursion formula for the distribution of $R_{d,k}(u)$. We discuss the implications on \glspl{MEG} in \cref{subsec:implications}. Let the random variable $U_n$ describe the number of balls in the urn after $n \in \mathbb{N}_0$ rounds. Let $u_0$ be the initial number of balls in the urn, then $U_0 = u_0$ and $U_{n+1} = U_n + k - R_{d,k}(U_n)$. As $(U_n)_{n \in \mathbb{N}_0}$ is a sequence of random variables, it is a stochastic process (cf.~e.g.~\cite{gallager}). We are interested in whether convergence can be \emph{expected}, and, if yes, how fast convergence is reached. The process is a spatially inhomogeneous random walk, specifically a time-homogeneous Markov chain (cf.~e.g.~\cite{mitzenmacher_upfal}) with state space $M_U = \mathbb{N}^+$: \vskip-10pt \begin{eqnarray*} \forall n \in \mathbb{N}_0 \enspace \forall u_0, \dots, u_{n+1} \in M_U: \quad\\ \mathbb{P}(U_{n+1} = u_{n+1} | U_0 = u_0, \dots, U_{n-1} = u_{n-1}, U_n = u_n) \\ \nonumber = \mathbb{P}(U_{n+1} | U_n = u_n) \Rightarrow \text{memorylessness} \end{eqnarray*} with transition matrix: $P_{i,j} = \mathbb{P}(U_n = j | U_{n - 1} = i) = \mathbb{P}(R_{d,k}(i) = k - (j - i))$ and transition probability: $\forall n \in \mathbb{N}_0 \forall l, m \in M_U: \mathbb{P}(U_n = j | U_{n-1} = i) = \mathbb{P}(U_1 = j | U_0 = i) $. Thus, the transitions are independent of $n$ and the process is time-homogeneous. A positive recurrent, aperiodic and irreducible Markov chain has a stationary distribution, i.e., a fixed point of the transition function in which the probabilities for the next state do not change with state transitions. If we assume $u_0 \in [0, k-1]$, then $u_1 > k$, as no more than $u_0$ balls can be drawn, but $k$ balls get added. Therefore, states $[0, k-1]$ are transient, and one can remove them from the chain. The remaining states are irreducible and aperiodic: As the next state increment in one round is in $[k - k \cdot d, k - d]$, every other state can be reached in a finite number of iterations. However, it is unclear whether the states are transient, i.e., visited only once, or positively recurrent, i.e., have a finite expected time until they are visited repeatedly. This represents an open problem and is left for future work. \subsection{Properties of Random Variable \texorpdfstring{$R_{d,k}(u)$}{R}}\label{subsec:stochastic_variable} As stated before, let $R_{d,k}(u)$ denote the total number of red balls that showed up in a single round of $k$ independent drawings of size $d$ from an urn of size $u$. Initially, the urn contains only red balls ($r = u$) and no black balls ($b$ = 0). A {\em drawing} means taking $d$ balls from the urn at random, where $d < u$. The drawing ends by replacing each red ball with a black ball and then returning all $d$ balls back into the urn. We now provide the expectation (a) and the variance (b) of $R_{d,k}(u)$, and a recursion formula (c) for the distribution of $R_{d,k}(u)$. For the proof, see \cref{apx:proof}. \begin{theorem}For the random variable $R_{d,k}(u)$, we have: \begin{enumerate} \item[a)] $ \displaystyle{ \BE(R_{d,k}(u)) = d \cdot \frac{1-p^k}{1-p}, \quad k \ge 1, }$\\ where \begin{equation}\label{defp} p = \frac{u-d}{u} \end{equation} is the retention probability. \item[b)] \begin{eqnarray*} \hspace{-8mm} \BV(R_{d,k}(u)) & = & \frac{vud}{1-p} \left(\frac{1-w^{k-1}}{1-w} - p^{k-1} \cdot \frac{1-(w/p)^{k-1}}{1-w/p}\right) \\ & & - \frac{vd^2}{(1-p)^2} \left(\frac{1\! -\! w^{k-1}}{1-w} - 2p^{k-1} \frac{1\! -\! (w/p)^{k-1}}{1-w/p} \right. \\ & & \hspace{2.5cm} \left. + p^{2(k-1)} \frac{1\! -\! (w/p^2)^{k-1}}{1-w/p^2}\right), \end{eqnarray*} where \begin{equation}\label{defv} v = \frac{d(u-d)}{u^2(u-1)}, \qquad w = \frac{(u-d)(u-d-1)}{u(u-1)}. \end{equation} \item[c)] If $k \ge 2$ then \[ \hspace{-6mm} \PP(R_{d,k}(u)=j) = \sum_{\ell =0}^d \frac{{\binom{u -(j-\ell)}{\ell}}{\binom{j - \ell}{d-\ell}}}{{\binom{u}{d}}} \cdot \PP(R_{d,k-1}(u) = j-\ell). \] \end{enumerate} \end{theorem} \subsection{Implications for the MEG and Conjecture}\label{subsec:implications} The formula for the expectation of $R_{d,k}(u)$ allows for statements on the expected convergence behavior of the \gls{MEG} in the presence of concurrent updates by different replicas. In addition, the formula for the variance of $R_{d,k}(u)$ shows the deviation from expected convergent behavior. For \Cref{fig:forward-extremities-development}, we use these formulas to calculate the expected development and deviation of forward extremities $U_n$ over the number of rounds for varying $k$ but fixed $d$. To plot the calculations, we put different realizations of $U_n$ against the expected value of $U_{n+1}$, via $\mathbb{E}(U_{n+1}) = U_{n} + k - \mathbb{E}(R_{d,k}(U_{n})$. The dashed line is $U_{n+1} = U_n$, so its intersection with the colored lines mark their fixed points. In the area below the dashed line, $\BE(U_{n+1}) < U_n$, the urn contents are expected to decrease, in accordance with the plotted standard deviation. The change from linear to constant curves (for decreasing $U_n$, i.e.~from right to left) show the switch from likely overlap-free choices to overlapping choices, which decrease the urn contents less. It shows that for any plotted realization of $U_n$, we either expect a decreasing urn value (below the dashed line), or a transition to the fixed point. Therefore, the plotted configurations show convergence. In addition, the variance is very low. We observe that the convergence of the width of the graph appears to be almost optimal, i.e., the fixed point is near $k$. \begin{figure}[tbp] \resizebox{\linewidth}{!}{ \includegraphics[clip,trim=0mm 0mm 0mm 0mm]{assets/next-step-expectations.png} } \caption{Expectation for the next urn content $\mathbb{E}(U_{n+1})$ for different realizations of $U_n$, $d=5$, and varying $k$. Points below the dashed line of $U_n = \BE(U_{n+1})$ mean that the urn content is expected to decrease, points above mean that an increase is expected. For visibility, the plotted standard deviation is increased by the factor 5. Please note that when the curves are followed from right to left, they change from a linear slope to a constant value close to $k$.} \label{fig:forward-extremities-development} \end{figure} Synapse, the reference implementation of a Matrix replica, recently activated a feature to force the depletion of forward extremities by sending empty `dummy' events using the same parent selection rules as regular events\footnote{Note that Synapse actually takes 5 random forward extremities and 5 of the newest forward extremities, which are not independent between replicas.} with $d=10$, as soon as there are more than 10 forward extremities present~\cite{synapse-dummy-events}. This fact allows to take advantage of the convergence in periods of missing updates, and brings reality closer to our model. \begin{figure}[tbp] \resizebox{\linewidth}{!}{ \includegraphics[clip,trim=0mm 15mm 0mm 10mm]{assets/rounds-until-convergence.png} } \caption{Expected number of rounds until convergence for varying $d$ and $k$, starting at $u_0 = 100\cdot k$. While convergence speed increases with $d$, the returns in the number of rounds to reach convergence diminish.} \label{fig:rounds-until-convergence} \end{figure} To gain insights into the influence of $d$, we use the expectation of $U_n$ via $\BE(U_{n+1}) = \BE(U_n) + k - \BE(R_{d,k}(U_n))$, and calculate the number of rounds $n$ until $\mathbb{E}(U_n) - \mathbb{E}(U_{n+1}) < 1$. This is equivalent to the number of rounds after which $\mathbb{E}(R_{d,k}(\mathbb{E}(U_n))) \ge k$ holds, i.e., the number of rounds after which we expect to eliminate a number of forward extremities in Step 1 that is less than or equal to the number of forward extremities that we add in Step 2. \cref{fig:rounds-until-convergence} shows that, while the number of rounds until convergence is reached directly depends on the choice of $d$, there are diminishing returns. The highest gain in time until convergence is between $d=2$ and $d=3$, while there is much less difference between $d=6$ and $d=10$. With optimal choice of forward extremities, i.e., $u \gg k\cdot d$, convergence speed is nearly $k \cdot (1-d)$, and therefore the number of rounds until convergence is nearly proportional to $\frac{1}{1-d}$. Synapse employs $d=5$ with $k \lessapprox 10^3$, which we can confirm as a good compromise in convergence speed performance using our formulas in \cref{fig:forward-extremities-development,fig:rounds-until-convergence}. With small $u$, bad choices, i.e., overlapping choices for parents are made, but because $u$ is small, they don't harm convergence permanently. With large $u$, the probability for overlapping choices grows smaller and smaller, and convergence speed is linear. We therefore conjecture that regardless of the exact choice of $k$ and $d$, the process converges for any start value $u$ to a stationary value near $k$ in a finite number of rounds. The derived properties of $R_{d,k}(u)$ are important building blocks to eventually prove this conjecture. The convergence speed depends on the choice of $d$, but values larger than 3 are subject of diminishing returns. In practice, this means that if the conjecture holds, the \gls{MEG} possesses a self-stabilization property~\cite{self-stabilization} in the sense that if transient faults lead to a high number of forward extremities (a high $u$), a correct system converges to a stable number of forward extremities near $k$ in a finite number of rounds, and remains stable as if the fault had never occured. \section{Conclusion} \label{sec:conclusion} In this paper, we extracted and abstracted the replicated data type employed by Matrix, and proved that it represents a Conflict-Free Replicated Data Type. Therefore, the Matrix Event Graph provides Strong Eventual Consistency, a fact that in particular indicates that all correct replicas that applied the same set of updates are in equivalent state --- immediately and without any further agreement procedure. This proof gives fundamental insights into why the Matrix system shows good resilience and scalability in the number of replicas in practice. It therefore makes the underlying replicated data type an attractive candidate as a basis for other decentralized applications. In addition, we analyzed the challenges for systems with byzantine actors and showed that the properties of the Matrix Event Graph facilitate a byzantine-tolerant design, especially due to equivocation tolerance. However, design and analysis of an appropriate underlying broadcast protocol with the identified properties remain topics for future research. Furthermore, we formalized and studied the evolution of the width of the graph as a spatially inhomogeneous random walk. Our observations let us conjecture that the width of the graph always converges independently of the specific system parameters, and does so fast. In summary, we believe that the Matrix system and similar systems are highly relevant in real-world scenarios, and that their scientific understanding is of utmost importance. We hope that our results advance understanding as well as proper real-world setup of those systems, and can serve as a basis for further research.
{ "redpajama_set_name": "RedPajamaArXiv" }
1,578
Q: Fonts in website not showing up correctly on iOS devices I'm building my first website from scratch and in the meantime, I would like to have a "Work in progress" page. The page works correctly on Desktop and Android devices, but the font is displayed in a weird way on iOS devices, a little bit shrunk vertically and doubled. My css looks like this right now and I can't figure out what's the problem. @font-face { font-family: 'montserratregular'; src: url('fonts/montserrat-regular-webfont.woff2') format('woff2'), url('fonts/montserrat-regular-webfont.woff') format('woff'), url('fonts/montserrat-regular-webfont.eot') format('embedded-opentype'), url('fonts/montserrat-regular-webfont.ttf') format('truetype'), url('fonts/montserrat-regular-webfont.otf') format('opentype'); font-weight: normal; font-style: normal; } Not even all of these should be necessary, since I think that ttf and woff (eventually wof2) should be enough. EDIT: Screenshot for reference:
{ "redpajama_set_name": "RedPajamaStackExchange" }
8,480
\section{Introduction.} The kaons have a long and rich story of a puzzling and cumbersome system. We shall not recall here the many steps that went from the $\tau-\theta$ puzzle \cite{Lee} to the intricacies of $CP$-violation \cite{ChristensonCroninFitchTurlay}\cite{WinsteinWolfenstein}. With the increase of the available energy came the discovery of the system of the $D$ mesons, similar in many respects to the latter. Presently, other thresholds have been crossed, but we shall stay here beyond the bottom threshold and mainly concentrate on $K$ and $D$ mesons; this corresponds, in the quark language \cite{GellMann}, to two generations. We do not, however, study these particles from the quark point of view, but follow \cite{Machet3} that brings forward an electroweak gauge theory for the $J=0$ mesons themselves; those are thus both the fields and the particles of the model which is, besides, compatible with the electroweak standard model for quarks \cite{GlashowSalamWeinberg} (see section \ref{section:reps}). In \cite{Machet3}, I exhibited in particular all their electroweak representations with a given $CP$ quantum number, in the form of $N^2/2$ quadruplets ($N/2$ is the number of generations), containing a neutral singlet and a triplet of the custodial $SU(2)_V$ symmetry; this symmetry, different from what it is generally assumed to be \cite{SikivieSusskindVoloshinZakharov}, was shown there to be linked to the quantization of the electric charge (the extension to the leptonic sector was studied in \cite{Machet4}). I particularize here the study and show that:\l -\quad the electroweak mass eigenstates are different from their usual quark content attributed from a classification by the $SU(4)$ group of flavour, symmetry of strong interactions; in particular, the alignment of strong and electroweak $K$ and $D$ mesons is impossible, even at the limit of vanishing mixing (Cabibbo) angle;\l -\quad unlike what happens in the electroweak standard model for quarks, \cite{GlashowSalamWeinberg}\cite{KobayashiMaskawa}, one can now construct already with two generations a $SU(2)_L \times U(1)$ invariant gauge Lagrangian for $J=0$ mesons which is not $CP$ invariant, and the electroweak mass eigenstates of which are not eigenstates of $CP$. \section{Electroweak representations of {\boldmath $J=0$} mesons.} \label{section:reps} I adopt the point of view that there is no loophole in the experimental determination of the parity of $J=0$ mesons. We know that this has been questioned \cite{Lee}, and will see that it might still be, but it allows us to work with electroweak mesonic representations the entries of which have a definite parity, and we put aside in this paper the possibility of an admixture of scalars and pseudoscalars. We know then from \cite{Machet3} that one can find quadruplet representations of the electroweak $SU(2)_L \times U(1)$ gauge group which are of two types: the first contains a scalar singlet and a pseudoscalar triplet of the custodial $SU(2)_V$: \begin{equation} ({\Bbb M}\,^0, \vec {\Bbb M}) = ({\Bbb S}^0, \vec {\Bbb P}), \label{eq:SP} \end{equation} and the second a pseudoscalar singlet and a scalar triplet: \begin{equation} ({\Bbb M}\,^0, \vec {\Bbb M}) = ({\Bbb P}\,^0, \vec {\Bbb S}). \label{eq:PS} \end{equation} The $SU(2)_L$ group acts on both by: \begin{eqnarray} T^i_L. {\Bbb M}^j &=& -{i\over 2}( \epsilon_{ijk}{\Bbb M}^k + \delta_{ij}{\Bbb M}^0),\cr T^i_L. {\Bbb M}^0 &=& {i\over 2} {\Bbb M}^j, \label{eq:action}\end{eqnarray} and mixes, as expected from its ``left-handed'' nature, scalars and pseudoscalars. The action of the $U(1)$ group results from the Gell-Mann-Nishijima relation as explained in \cite{Machet3}. All entries are $N\times N$ matrices, where $N$ is the number of ``flavours'', and the quadruplets can be written \vbox{ \begin{eqnarray} & &\Phi(\Bbb D)= ({\Bbb M}\,^0, {\Bbb M}^3, {\Bbb M}^+, {\Bbb M}^-)(\Bbb D)\cr = & & \left[ {1\over \sqrt{2}}\left(\begin{array}{ccc} {\Bbb D} & \vline & 0\\ \hline 0 & \vline & {\Bbb K}^\dagger\,{\Bbb D}\,{\Bbb K} \end{array}\right), {i\over \sqrt{2}} \left(\begin{array}{ccc} {\Bbb D} & \vline & 0\\ \hline 0 & \vline & -{\Bbb K}^\dagger\,{\Bbb D}\,{\Bbb K} \end{array}\right), i\left(\begin{array}{ccc} 0 & \vline & {\Bbb D}\,{\Bbb K}\\ \hline 0 & \vline & 0 \end{array}\right), i\left(\begin{array}{ccc} 0 & \vline & 0\\ \hline {\Bbb K}^\dagger\,{\Bbb D} & \vline & 0 \end{array}\right) \right];\cr & & \label{eq:reps} \end{eqnarray} } ${\Bbb K}$ is a $N/2 \times N/2$ unitary matrix that reduces, for $N=4$ to the Cabibbo matrix \cite{Cabibbo}; $\Bbb D$ is also a real $N/2 \times N/2$ matrix. That the entries ${\Bbb M}^+$ and ${\Bbb M}^-$ are, up to a sign, hermitian conjugate ({\em i.e.} charge conjugate), requires that the $\Bbb D$'s are restricted to symmetric or antisymmetric matrices. The group action (\ref{eq:action}) for the quadruplets is a particular case of a more general one which involves commuting and anticommuting $N\times N$ matrices inside the $U(N)_R \times U(N)_L$ chiral algebra; the generators of the $SU(2)_L$ and $U(1)$ subgroups are themselves represented by $N\times N$ matrices \cite{Machet3}, \begin{equation} {\Bbb T}^3_L = {1\over 2}\left(\begin{array}{ccc} {\Bbb I} & \vline & 0\\ \hline 0 & \vline & -{\Bbb I} \end{array}\right),\ {\Bbb T}^+_L = \left(\begin{array}{ccc} 0 & \vline & {\Bbb K}\\ \hline 0 & \vline & 0 \end{array}\right),\ {\Bbb T}^-_L = \left(\begin{array}{ccc} 0 & \vline & 0\\ \hline {\Bbb K}^\dagger & \vline & 0 \end{array}\right), \label{eq:SU2L} \end{equation} acting trivially on $N$-vectors of quarks if they are taken as the fundamental fields (the action of the gauge group on the mesons can be deduced from that on the quarks when the former are considered as $\bar q_i q_j$ or $\bar q_i\gamma_5 q_j$ composite states). Symmetric $({\Bbb S}^0, \vec {\Bbb P})$ and antisymmetric $({\Bbb P}^0, \vec {\Bbb S})$ representations are $CP$-even, while antisymmetric $({\Bbb S}^0, \vec {\Bbb P})$ and symmetric $({\Bbb P}^0, \vec {\Bbb S})$ representations are $CP$-odd. The $C$, and hence the $CP$ quantum number of a representation can be swapped by multiplying its entries by $\pm i$. Restricting to $N=4$, we write below the four types of $({\Bbb M}^0, {\Bbb M}^3, {\Bbb M}^+, {\Bbb M}^-)$ quadruplets that appear, corresponding respectively to \begin{equation} {\Bbb D}_1 = {\Bbb I}= \left( \begin{array}{rr} 1 & 0 \cr 0 & 1 \end{array}\right),\quad {\Bbb D}_2 = \left( \begin{array}{rr} 1 & 0 \cr 0 & -1 \end{array}\right),\quad {\Bbb D}_3 = \left( \begin{array}{rr} 0 & 1 \cr 1 & 0 \end{array}\right),\quad {\Bbb D}_4 = \left( \begin{array}{rr} 0 & 1 \cr -1 & 0 \end{array}\right); \end{equation} \vbox{ \begin{eqnarray} & &\Phi({\Bbb D}_1) = \cr & & \hskip -2cm \left[ {1\over\sqrt{2}} \left(\begin{array}{rrcrr} 1 & &\vline & & \nonumber\\ & 1 &\vline & & \nonumber\\ \hline & &\vline & 1 & \nonumber\\ & &\vline & & 1 \end{array} \right), {i\over\sqrt{2}} \left(\begin{array}{rrcrr} 1 & &\vline & & \nonumber\\ & 1 &\vline & & \nonumber\\ \hline & &\vline &-1 & \nonumber\\ & &\vline & & -1 \end{array} \right), i \left(\begin{array}{rrcrr} & &\vline & c_\theta & s_\theta \nonumber\\ & &\vline &-s_\theta & c_\theta \nonumber\\ \hline & &\vline & & \nonumber\\ & &\vline & & \end{array} \right), i \left(\begin{array}{rrcrr} & &\vline & & \nonumber\\ & &\vline & & \nonumber\\ \hline c_\theta &-s_\theta &\vline & & \nonumber\\ s_\theta & c_\theta &\vline & & \end{array} \right) \right]; \nonumber\\ & & \label{eq:PHI1} \end{eqnarray} } \vbox{ \begin{eqnarray} & &\Phi({\Bbb D}_2) = \cr & & \hskip -2cm \left[ {1\over\sqrt{2}} \left(\begin{array}{rrcrr} 1 & &\vline & & \nonumber\\ & -1 &\vline & & \nonumber\\ \hline & & \vline & c_\theta^2 - s_\theta^2 & 2c_\theta s_\theta \nonumber\\ & & \vline & 2c_\theta s_\theta & s_\theta^2 -c_\theta^2 \end{array} \right), {i\over\sqrt{2}} \left(\begin{array}{rrcrr} 1 & & \vline & & \nonumber\\ & -1 & \vline & & \nonumber\\ \hline & & \vline & s_\theta^2 - c_\theta^2 & -2c_\theta s_\theta \nonumber\\ & & \vline & -2c_\theta s_\theta & c_\theta^2 - s_\theta^2 \end{array} \right), \right .\nonumber\\ & & \hskip 7cm \left . i \left(\begin{array}{rrcrr} & &\vline & c_\theta & s_\theta \nonumber\\ & &\vline & s_\theta & -c_\theta \nonumber\\ \hline & &\vline & & \nonumber\\ & &\vline & & \end{array} \right), i \left(\begin{array}{rrcrr} & &\vline & & \nonumber\\ & &\vline & & \nonumber\\ \hline c_\theta & s_\theta &\vline & & \nonumber\\ s_\theta & -c_\theta &\vline & & \end{array} \right) \right]; \nonumber\\ & & \label{eq:PHI2} \end{eqnarray} } \vbox{ \begin{eqnarray} & &\Phi({\Bbb D}_3) = \cr & & \hskip -2cm \left[ {1\over\sqrt{2}} \left(\begin{array}{rrcrr} & 1 &\vline & & \nonumber\\ 1 & &\vline & & \nonumber\\ \hline & & \vline & -2c_\theta s_\theta & c_\theta^2 - s_\theta^2 \nonumber\\ & & \vline & c_\theta^2 - s_\theta^2 & 2c_\theta s_\theta \end{array} \right), {i\over\sqrt{2}} \left(\begin{array}{rrcrr} & 1 & \vline & & \nonumber\\ 1 & & \vline & & \nonumber\\ \hline & & \vline & 2c_\theta s_\theta & s_\theta^2 - c_\theta^2 \nonumber\\ & & \vline & s_\theta^2 - c_\theta^2 & -2c_\theta s_\theta \end{array} \right), \right .\nonumber\\ & & \hskip 7cm \left . i \left(\begin{array}{rrcrr} & & \vline & -s_\theta & c_\theta \nonumber\\ & & \vline & c_\theta & s_\theta \nonumber\\ \hline & &\vline & & \nonumber\\ & &\vline & & \end{array} \right), i \left(\begin{array}{rrcrr} & &\vline & & \nonumber\\ & &\vline & & \nonumber\\ \hline -s_\theta & c_\theta &\vline & & \nonumber\\ c_\theta & s_\theta &\vline & & \end{array} \right) \right]; \nonumber\\ & & \label{eq:PHI3} \end{eqnarray} } \vbox{ \begin{eqnarray} & &\Phi({\Bbb D}_4) = \cr & & \hskip -2cm \left[ {1\over\sqrt{2}} \left(\begin{array}{rrcrr} & 1 &\vline & & \nonumber\\ -1 & &\vline & & \nonumber\\ \hline & &\vline & & 1 \nonumber\\ & &\vline & -1 & \end{array} \right), {i\over\sqrt{2}}\left(\begin{array}{rrcrr} & 1 &\vline & & \nonumber\\ -1 & &\vline & & \nonumber\\ \hline & &\vline & & -1 \nonumber\\ & &\vline & 1 & \end{array} \right), i \left(\begin{array}{rrcrr} & &\vline & -s_\theta & c_\theta \nonumber\\ & &\vline & -c_\theta & -s_\theta \nonumber\\ \hline & &\vline & & \nonumber\\ & &\vline & & \end{array} \right), i \left(\begin{array}{rrcrr} & &\vline & & \nonumber\\ & &\vline & & \nonumber\\ \hline s_\theta & c_\theta &\vline & & \nonumber\\ -c_\theta & s_\theta &\vline & & \end{array} \right) \right]; \nonumber\\ & & \label{eq:PHI4} \end{eqnarray} } $c_\theta$ and $s_\theta$ stand respectively for the cosine and sine of the Cabibbo angle $\theta_c$. We shall also use in the following the notations \begin{equation} ({\Bbb S}^0, \vec{\Bbb P})({\Bbb D}_1)= \Phi_1,\quad ({\Bbb S}^0, \vec{\Bbb P})({\Bbb D}_2)= \Phi_2,\quad ({\Bbb S}^0, \vec{\Bbb P})({\Bbb D}_3)= \Phi_3,\quad ({\Bbb S}^0, \vec{\Bbb P})({\Bbb D}_4)= \Phi_4. \label{eq:notation}\end{equation} While there is of course no antisymmetric $\Bbb D$ for $N=2$ (one generation), ${\Bbb D}_4$ is such a matrix for $N=4$ and is the only one in this case. Though quarks never appear as fundamental fields, the reader can easily make the link between the mesons, represented above as $4\times 4$ matrices, and their quark ``content'': it is simply achieved by sandwiching a given matrix belonging to a representation between fermionic 4-vectors $(\bar u, \bar c, \bar d, \bar s)$ and $(u,c,d,s)$, and by remembering the parity of the corresponding particle. With the scaling that has to be introduced \cite{Machet1,Machet2,Machet3}, we have, for example \begin{equation} {\Bbb P}^+({\Bbb D}_1) = i{f\over \langle H\rangle}\left(c_\theta (\pi^+ + D_s^+) + s_\theta (K^+ -D^+)\right), \end{equation} where, according to the classification by flavour $SU(4)$, we have translated, for pseudoscalars, $\bar u d$ into $\pi^+$, $\bar u s$ into $K^+$, $\bar c d$ into $D^+$ and $\bar c s$ into $D_s^+$ etc \ldots; $f$ is the leptonic decay constant of the mesons (considered to be the same for all of them) and $H$ is the Higgs boson. We always refer to $\pi, K, D, D_s$ as the eigenstates of strong interactions. \section{The mass and \boldmath{$CP$} eigenstates for \boldmath{$\theta_{c}=0$}.} \subsection{Quadratic invariants.} For the sake of simplicity, we shall deal here with the case of vanishing Cabibbo angle. It teaches us the main features of the unavoidable misalignment between strong and electroweak eigenstates. To every representation is associated a quadratic expression invariant by the electroweak gauge group \begin{equation} {\cal I} = ({\Bbb M}^0, \vec {\Bbb M})\otimes ({\Bbb M}^0, \vec {\Bbb M})= {\Bbb {\Bbb M}}\,^0 \otimes {\Bbb {\Bbb M}}\,^0 + \vec {\Bbb M} \otimes \vec {\Bbb M}; \label{eq:invar} \end{equation} the ``$\otimes$'' product is a tensor product, not the usual multiplication of matrices and means the product of fields as functions of space-time; $\vec {\Bbb M} \otimes \vec {\Bbb M}$ stands for $\sum_{i=1,2,3} {\Bbb M}\,^i \otimes {\Bbb M}\,^i$. The representations $\Phi$ are such that the algebraic sum (to be specified below) of the corresponding invariants is diagonal both in the electroweak basis and in the basis of strong eigenstates; in particular, the (quadratic) part of the kinetic terms that involves ordinary derivatives \begin{eqnarray} {1\over 2} \sum_{i= 1,2,3}& &\left( -\partial_\mu ({\Bbb S}^0, \vec {\Bbb P})({\Bbb D}_i) \otimes \partial^\mu ({\Bbb S}^0, \vec {\Bbb P})({\Bbb D}_i)+ \partial_\mu ({\Bbb S}^0, \vec {\Bbb P})({\Bbb D}_4) \otimes \partial^\mu ({\Bbb S}^0, \vec {\Bbb P})({\Bbb D}_4)\right.\cr & &\left. +\partial_\mu ({\Bbb P}^0, \vec {\Bbb S})({\Bbb D}_i) \otimes \partial^\mu ({\Bbb P}^0, \vec {\Bbb S})({\Bbb D}_i) -\partial_\mu ({\Bbb P}^0, \vec {\Bbb S})({\Bbb D}_4) \otimes \partial^\mu ({\Bbb P}^0, \vec {\Bbb S})({\Bbb D}_4)\right) \label{eq:LK}\end{eqnarray} is also diagonal in the strong eigenstates, with the same normalization factor $1$ for all of them; the relative signs that must be introduced for this purpose are due to the following:\l - all pseudoscalars we define without an ``$i$'' (like $\pi^+ = \bar u d_{P-odd}$), such that the $({\Bbb P}^0, \vec{\Bbb S})$ quadruplets have to be multiplied by $\pm i$;\l - the skew-symmetry of ${\Bbb D}_4$ making the corresponding quadruplets have an opposite behaviour by charge conjugation as compared to the other six, introduces an extra minus sign in the corresponding quadratic invariants. Another invariant is the ``scalar product'' of two representations transforming alike by the gauge group; for example such is \begin{equation} {\cal I}_{12} = \Phi_1 \otimes \Phi_2 ={\Bbb S}^0({\Bbb D}_1) \otimes {\Bbb S}^0({\Bbb D}_2) + \vec {\Bbb P}({\Bbb D}_1) \otimes \vec {\Bbb P}({\Bbb D}_2). \label{eq:I12}\end{equation} Because of the remark starting section \ref{section:reps}, we {\em a priori} exclude connecting mesons of different parities inside an invariant like $({\Bbb S}^0, \vec {\Bbb P})({\Bbb D}_1)\otimes ({\Bbb P}^0, \vec {\Bbb S})({\Bbb D}_2)= {\Bbb S}^0({\Bbb D}_1) \otimes {\Bbb P}^0({\Bbb D}_2) + \vec {\Bbb P}({\Bbb D}_1) \otimes \vec {\Bbb S}({\Bbb D}_2)$. Note that the $SU(2)_L \times U(1)$ invariants do {\em not} involve tensorial products of hermitian conjugate (charge conjugate) fields, but of the fields themselves; for example ${\cal I}_{12} =\Phi_1 \otimes \Phi_2$ is given by (\ref{eq:I12}) and {\em not} by ${\Bbb S}^0 \otimes {\Bbb S}^{0\dagger} + \vec{\Bbb P} \otimes \vec{\Bbb P}^\dagger$. This underlies the results below. \subsection{A first possible attitude.}\label{subsection:first} One can choose the electroweak mass eigenstates to match the quadruplets displayed above; one then does not introduce crossed mass terms, and we have {\em a priori} eight independent mass scales. The mass eigenstates are also $CP$ eigenstates, but it is obvious that electroweak and strong eigenstates differ. Presumably, this choice is only reasonable in the case of three generations, because of the content of $\Phi_1$ \cite{Machet3}: $\Phi_1^0$ is the Higgs boson and the three $\vec\Phi$ form the triplet of Goldstone bosons of the broken electroweak gauge group; once ``eaten'' by the three gauge fields that get massive by so doing, they become their longitudinal degrees of freedom, the mass of which are consequently expected to match those of the gauge bosons; only in the case of three generations can we expect three (at least) pseudoscalar mesons to be as heavy as the $W^\pm, Z$. We know now that some mesons interpreted to contain the ``top'' quark weight as much as $175 GeV$ \cite{topmass}, but the possibility is wide open that three among the eleven pseudoscalar mesons including the top quark are identical with the longitudinal $W^\pm, Z$: indeed, in the present picture, the mass of the asymptotic states (mesons) is disconnected from that of their constituents fields, and different mass scales can be attributed, in a $SU(2)_L \times U(1)$ invariant way, to different representations. independently of their ``quark content''; since the eleven above mentioned ``topped'' pseudoscalar mesons will fit into several quadruplets, there is no reason why they should correspond to a single mass scale. \subsection{The \boldmath{$\pi-D_s$} mass splitting.} The second attitude is to attempt to align strong and weak eigenstates, at least some of them, and we first focus on the two representations $\Phi_1$ and $\Phi_2$ defined in (\ref{eq:notation}). Consider the mass term \begin{equation} {\cal L}_m = {1\over 2} ( m_1^2 \Phi_1 \otimes \Phi_1 + m_2^2 \Phi_2 \otimes \Phi_2 -2m_{12}^2 \Phi_1 \otimes \Phi_2). \end{equation} It is diagonalized, in the charged sector for example, by the states \begin{eqnarray} A^+ &=&{1\over 2}\left( \sqrt{m_1\over m_2}(\pi^+ + D_s^+) + \sqrt{m_2\over m_1}(\pi^+ - D_s^+) \right),\cr B^+ &=&{1\over 2}\left( \sqrt{m_1\over m_2}(\pi^+ + D_s^+) - \sqrt{m_2\over m_1}(\pi^+ - D_s^+) \right), \end{eqnarray} and their charge conjugate. The same happens in the neutral sector. For $m_1 = m_2 =m$, the kinetic terms are also diagonal in $\vec A$ and $\vec B$, in which case $\vec A$ and $\vec \pi$ are aligned, so are $\vec B$ and $\vec D_s$, with masses squared $m^2 \pm m_{12}^2$. \subsection{The \boldmath{$K-D$} system.}\label{subsection:KD} We shall now see that, because the matrices ${\Bbb D}_3$ and ${\Bbb D}_4$ have opposite symmetry properties, it is impossible to align strong and electroweak eigenstates in the $K-D$ system (the only exception is the trivial one, corresponding to degenerate $K$ and $D$ mesons). Consider the two electroweak representations $U$ and $V$ obtained by combining $\Phi_3$ and $\Phi_4$ defined in (\ref{eq:notation}) \vbox{ \begin{equation} \left\{ \begin{array}{ccc} \Phi_3 &=& \alpha U + \beta V, \\ \Phi_4 &=& \delta U + \zeta V. \end{array} \right. \label{eq:PhiPhi}\end{equation} } That the ($CP$ invariant) kinetic term \begin{equation} {\cal L}_{kin} =-{1\over 2}(\partial_\mu \Phi_3 \otimes\partial^\mu \Phi_3 - \partial_\mu \Phi_4 \otimes\partial^\mu \Phi_4) \label{eq:Lkin} \end{equation} stays diagonal in $U$ and $V$ requires \begin{equation} \alpha\beta -\delta\zeta =0. \label{eq:diag}\end{equation} Let us introduce the ($CP$ invariant) mass terms \begin{equation} {\cal L}_m = {1\over 2} (m_3^2 \Phi_3 \otimes \Phi_3 -m_4^2 \Phi_4 \otimes \Phi_4 - 2im_{34}^2 \Phi_3 \otimes \Phi_4). \label{eq:Lm}\end{equation} We leave aside the case $m_3^2 = m_4^2,\ m_{34}^2 =0$ which corresponds to degenerate $K$ and $D$. If (\ref{eq:Lm}) can be diagonalized together with the kinetic terms, there should exist two mass scales $\mu_U^2$ and $\mu_V^2$ such that the quadratic Lagrangian invariant by $SU(2)_L \times U(1)$ is diagonal in $U$ and $V$: it then reads, using the condition (\ref{eq:diag}) \begin{equation} {\cal L} ={1\over 2}(\delta^2 -\alpha^2) (\partial_\mu U\otimes \partial^\mu U -{\beta^2\over \delta^2} \partial_\mu V\otimes \partial^\mu V) -{1\over 2}(\mu_U^2 U\otimes U -\mu_V^2 V\otimes V). \label{eq:LUV}\end{equation} The masses of $U$ and $V$ are \begin{equation} m_U^2 = {1\over \delta^2 -\alpha^2}\mu_U^2,\quad m_V^2 = {\delta^2 \over \beta^2(\delta^2 -\alpha^2)} \mu_V^2. \end{equation} We shall take hereafter, without loss of generality \begin{equation} \delta^2 -\alpha^2 =1 \label{eq:cond}\end{equation} and look for real $\delta^2$ and $\alpha^2$. The condition of reality is not a restriction for what we look at since $U$ and $V$ can only be aligned with strong eigenstates for $\alpha$ and $\delta$ both real or both imaginary (see (\ref{eq:UV})); this is impossible as we show below. Still making use of the condition (\ref{eq:diag}), and of the relation (\ref{eq:cond}), eqs.~(\ref{eq:PhiPhi}) invert to \begin{equation} \left\{ \begin{array}{ccc} U &=& \delta \Phi_4 -\alpha \Phi_3,\cr V &=& {\delta\over\beta}(\delta\Phi_3 -\alpha\Phi_4). \end{array} \right. \label{eq:UV}\end{equation} Replacing in (\ref{eq:LUV}), one gets, by matching it with (\ref{eq:Lm}), the system \vbox{ \begin{equation} \left\{ \begin{array}{ccccc} m_3^2 &=& -\alpha^2 \mu_U^2 +\delta^2{\delta^2\over\beta^2}\mu_V^2 &=& \mu_U^2 - \delta^2(\mu_U^2 - {\delta^2\over\beta^2}\mu_V^2),\cr m_4^2 &=& \phantom{-}\delta^2 \mu_U^2 -\alpha^2 {\delta^2\over\beta^2}\mu_V^2 &=& \mu_U^2 + \alpha^2(\mu_U^2 - {\delta^2\over\beta^2}\mu_V^2),\cr m_{34}^2 &=& i\alpha\delta(\mu_U^2 - {\delta^2\over\beta^2}\mu_V^2), & & \end{array} \right. . \label{eq:mmm}\end{equation} One can extract from the first two equations of (\ref{eq:mmm}): \begin{equation} m_U^2 = \frac{m_4^2 +\alpha^2(m_3^2 + m_4^2)}{1 +2\alpha^2},\quad m_V^2 = \frac{m_3^2 +\alpha^2(m_3^2 + m_4^2)}{1 +2\alpha^2}, \label{eq:mUmV}\end{equation} } and, from the third equation of (\ref{eq:mmm}) together with (\ref{eq:cond}), one finds that $\alpha^2$ must satisfy \begin{equation} \alpha^4 +\alpha^2 +{\xi^2 \over 4(1+\xi^2)} =0,\quad \xi = {2m_{34}^2 \over m_4^2 - m_3^2}. \label{eq:alpha1}\end{equation} It only has real solutions in $\alpha ^2$ for $\alpha^2 < 0$; we then go to $\rho = -i\alpha$, and the solutions of (\ref{eq:alpha1}) are \begin{equation} \rho^2 = \frac{1 \pm\sqrt{1\over 1+\xi^2}}{2}. \label{eq:rho} \end{equation} $\rho^2$ is always smaller than $1$, such that $\delta^2 = 1-\rho^2$ is always positive and $\delta$ real. $U$ has $CP = -1$, and $V$ has $CP = +1$ if $\beta$ is chosen to be real. Due in particular to $\alpha = i\rho$ in eqs.~(\ref{eq:UV}), both $U$ and $V$ are different from ``strong'' eigenstates. The case $\rho =0$ corresponds to a vanishing crossed mass term $m_{34}^2 =0$ and to the alignment of $U$ with $\Phi_3$, and of $V$ with $\Phi_4$ (see subsection \ref{subsection:first}). The apparently singular case $\alpha^2 =-1/2$ in (\ref{eq:mUmV}) is better treated directly from eq.~(\ref{eq:Lm}) since it also corresponds to $m_3^2 = m_4^2 =m^2$: the eigenvectors are $\Phi_3 \pm i\Phi_4$ and the corresponding masses $m^2 \pm m_{34}^2$. To fix the ideas, let us take a very simple example: $\xi^2 = 3, \rho = 1/2, \delta =\sqrt{3}/2$; one has then \begin{equation} m_U^2 = {3 m_4^2 - m_3^2 \over 2}, \quad m_V^2 = {3 m_3^2 - m_4^2 \over 2}; \end{equation} $U^\pm$ and $V^\pm$ write \vbox{ \begin{eqnarray} U^+ &=& \hphantom{-}{1\over 2}\left((1+i\sqrt{3})K^+ + (1-i\sqrt{3})D^+\right),\cr U^- &=& {1\over 2}\left((1-i\sqrt{3})K^- +(1+i\sqrt{3})D^-\right) =\overline{U^+} =-CP\quad U^+,\cr V^+ &=& {\sqrt{3}\over 4\beta} \left((1+i\sqrt{3})K^+ -(1-i\sqrt{3})D^+\right),\cr V^- &=& -{\sqrt{3}\over 4\beta} \left((1-i\sqrt{3})K^- -(1+i\sqrt{3})D^-\right)=-\overline{V^+} = +CP\quad V^+. \end{eqnarray} } Since $iK^+$ and $K^+$ have opposite $CP$ transformation, and likewise $iD^+$ and $D^+$, the charged electroweak mass eigenstates are expected to decay into two as well as three pions. This provides a natural explanation for the $\tau-\theta$ puzzle in the charged sector \cite{Lee}. In the neutral sector, one gets: \vbox{ \begin{eqnarray} U^3 &=& {1\over 2\sqrt{2}}\left((1+i\sqrt{3})(\overline{D^0}-K^0) +(1-i\sqrt{3})({D^0}-\overline{K^0})\right) = +\overline{U^3}= -CP\quad U^3,\cr V^3 &=& {\sqrt{3}\over 4\sqrt{2}\beta}\left((1+i\sqrt{3})(\overline{D^0}-K^0) -(1-i\sqrt{3})({D^0}-\overline{K^0})\right) =-\overline{V^3}= +CP\quad V^3.\cr & & \end{eqnarray} } $U^3$ and $\pm iU^3$ have opposite $C$, thus opposite $CP$, and are degenerate in mass; so are $V^3$ and $\pm iV^3$; in fact, because of the $C$ quantum number, we do not deal, for $N=4$, with sixteen pseudoscalar mesons, but with twice as many; they are pairwise degenerate when the mass eigenstates are also $CP$ eigenstates. The same occurs in the scalar sector. That the lightest pair, for example $U^3, \pm iU^3$ could be identified as the short-lived and long-lived neutral electroweak kaons is left as an open possibility. \footnote{In \cite{Machet3}, I proposed to look for $K_L$ and $K_S$ respectively as the neutral ${\Bbb P}^3$ of a $({\Bbb S}^0, \vec{\Bbb P})$ representation and the ${\Bbb P}^0$ of a $({\Bbb P}^0, \vec{\Bbb S})$. That one is then at a loss to explain the near mass degeneracy between the two motivates the alternate proposition made above.} \section{\boldmath{$CP$} violation with two generations (case \boldmath{$\theta_c =0$}).} We have all the necessary ingredients to construct an $SU(2)_L \times U(1)$ invariant Lagrangian which is not $CP$ invariant: hence, the corresponding mass eigenstates do not have a definite $CP$; it only requires the existence of at least one antisymmetric $\Bbb D$ matrix, that is two generations. The principle is to find eigenstates which diagonalize the entire quadratic Lagrangian, but which are linear combinations of $\Phi_i, i=1,2,3$ and $\Phi_4$ with {\em real} coefficients: the two types of quadruplets having different $CP$ properties, the eigenstates will not have a definite transformation by this operation. We shall work again, for example, in the mesonic subspace spanned by the two representations $\Phi_3$ and $\Phi_4$, but it must be clear that the phenomenon is more general and can occur with any set of quadruplets corresponding to two $\Bbb D$ matrices ${\Bbb D}_i, i=1,2,3$ and ${\Bbb D}_4$. With the same notations as in the previous section, we introduce the $SU(2)_L\times U(1)$ invariant, but now $CP$ non-invariant (without ``$i$'' in the crossed mass term) quadratic mass Lagrangian \begin{equation} {\cal L}_m = {1\over 2}( m_3^2 \Phi_3\otimes \Phi_3 -m_4^2 \Phi_4\otimes \Phi_4 + 2m_{34}^2 \Phi_3\otimes \Phi_4). \end{equation} The $CP$ invariant kinetic terms (\ref{eq:Lkin}) we keep unaltered, though expressed in terms of $U$ and $V$; that they stay diagonal as before requires again that the condition (\ref{eq:diag}) be satisfied. The argument goes exactly along the same lines as in the previous section, except that eq.~(\ref{eq:alpha1}) is now replaced by \begin{equation} \alpha^4 + \alpha^2 -{\xi^2 \over 4(1-\xi^2)} =0,\quad \xi = {2m_{34}^2 \over m_4^2 - m_3^2}, \end{equation} and has for solution \begin{equation} \alpha^2 = {-1 \pm \sqrt{1\over 1-\xi^2}\over 2}. \end{equation} The existence of a positive real solution for $\alpha^2$ requires $\xi^2 <1$, that is $2m_{34}^2 \leq \vert m_4^2 -m_3^2 \vert$. To fix the ideas as in the previous section, let us take the simple example $\xi^2 = 3/4, \alpha = \sqrt{1/2}, \delta =\sqrt{3/2}$. One has \begin{eqnarray} U^+ &=& -{i\over\sqrt{2}}\left((1 -\sqrt{3})K^+ +(1 +\sqrt{3})D^+\right),\cr U^- &=& -{i\over\sqrt{2}}\left((1+\sqrt{3})K^- +(1-\sqrt{3})D^-\right) \not = \pm CP\quad U^+,\cr V^+ &=& -{i\sqrt{3}\over 2\beta} \left((1-\sqrt{3})K^+ - (1+\sqrt{3})D^+\right),\cr V^- &=& \hphantom{-}{i\sqrt{3}\over 2\beta} \left((1+\sqrt{3})K^- -(1-\sqrt{3})D^-\right) \not = \pm CP\quad V^+, \end{eqnarray} and, in the neutral sector, \vbox{ \begin{eqnarray} U^3 &=& -{i\over 2}\left((1-\sqrt{3})(\overline{D^0}-K^0) + (1+\sqrt{3})(D^0 -\overline{K^0})\right),\cr V^3 &=& -{i\sqrt{3}\over 2\sqrt{2}\beta}\left((1-\sqrt{3})(\overline{D^0}-K^0) - (1+\sqrt{3})(D^0 -\overline{K^0})\right). \end{eqnarray} } $\overline{U^3} \not = \pm U^3,\ \overline{V^3} \not = \pm V^3$: the mass eigenstates $U^3$ and $V^3$ are consequently not $CP$ eigenstates. The masses of $\vec U$ and $\vec V$ are \begin{equation} m_U^2 = {3m_4^2 + m_3^2\over 4},\quad m_V^2 = {3m_3^2 + m_4^2\over 4}. \end{equation} Treating in perturbation a Lagrangian like (\ref{eq:LUV}) requires being able to use Green functions of the form $\langle T \varphi(x) \bar\varphi(y) \rangle$. When $U$ and $V$ were $C$ (and $CP$) eigenstates as in the previous section, all their entries were related to their charge conjugate by a simple sign, but this is no longer the case . For this reason, one must now switch to the fields $A=(U+\bar U)/2, B=(U -\bar U)/2, C= (V+\bar V)/2, D= (V-\bar V)/2$, the entries of which have definite properties by charge conjugation; this transforms (\ref{eq:LUV}) into \vbox{ \begin{eqnarray} {\cal L} =& &{1\over 2}(\delta^2 -\alpha^2)( (\partial_\mu A \otimes\partial^\mu\bar A -\partial_\mu B \otimes\partial^\mu\bar B + 2 \partial_\mu A \otimes \partial^\mu B) \cr & & - {\beta^2\over \delta^2} (\partial_\mu C \otimes\partial^\mu\bar C -\partial_\mu D \otimes\partial^\mu\bar D +2 \partial_\mu C\otimes \partial^\mu D))\cr &-&{1\over 2}\left(\mu_U^2 (A\otimes \bar A - B\otimes \bar B +2 A\otimes B) -\mu_V^2 (C\otimes \bar C - D\otimes \bar D +2 C\otimes D)\right); \end{eqnarray} } though the ``masses'' stay unchanged, unavoidable non-diagonal quadratic terms, including derivative ones, appear. The whole kinetic Lagrangian, obtained from (\ref{eq:LK}) by replacing normal derivatives with covariant derivatives with respect to $SU(2)_L \times U(1)$, is $CP$ invariant. But while, by the construction given above, the part that only includes normal derivatives can be diagonalized either in $\vec\Phi_3$ and $\vec\Phi_4$ or in $\vec U$ and $\vec V$, there is no reason why the same should happen for the remaining terms which couple to the electroweak gauge bosons. As a consequence, loop corrections with gauge fields are expected to induce transitions between the $U$ and $V$ mass eigenstates, and the independent symmetries $U \rightarrow \pm iU, V \rightarrow \pm iV$ mentioned at the end of subsection \ref{subsection:KD} are broken. \section{The case of non-vanishing Cabibbo angle.} The Cabibbo rotation makes any pseudoscalar eigenstate of strong interactions a linear combination of no longer two but, for the charged states, of the four $({\Bbb S}^0, \vec {\Bbb P})({\Bbb D}_i), i=1\cdots 4$, and for the neutral states, of even more since $({\Bbb P}^0, \vec {\Bbb S})$ representations have to be included too. Since the coefficients of the linear combinations that determine the charged states are all real, the presence of both $\Phi_4$ and $\Phi_i, i=1,2,3$ makes impossible the alignment of strong and electroweak eigenstates in such a way that, inside a given representation, the charged ${\Bbb P}^\pm$ are related by charge conjugation. Let us indeed consider, for example, the two quadruplets \begin{equation} \Xi_1 ={1\over 2i}(c_\theta(\Phi_1 + \Phi_2) -s_\theta (\Phi_3 + \Phi_4)) \end{equation} and \begin{equation} \Xi_2 = {1\over 2i}(c_\theta(\Phi_1 + \Phi_2) -s_\theta (\Phi_3 - \Phi_4)). \end{equation} Their charged states are \begin{eqnarray} \Xi_1^+ &=& \pi^+,\cr \Xi_1^- & & c_\theta^2 \pi^- +c_\theta s_\theta(K^- -D^-) -s_\theta^2 D_s^-,\cr \Xi_2^+ &=& c_\theta^2 \pi^+ +c_\theta s_\theta(K^+ -D^+) -s_\theta^2 D_s^+,\cr \Xi_2^- &=& \pi^-; \end{eqnarray} so, even $\pi^\pm$ cannot be now electroweak mass eigenstates. In the neutral sector, the ``strong'' $\pi^0$ can be written \vbox{ \begin{eqnarray} \pi^0 &=& \left.{(\bar u u - \bar d d)\over\sqrt{2}}\right|_{P-odd} = {1\over 2}({\Bbb P}^0 -i {\Bbb P}^3)({\Bbb D} =\left(\begin{array}{cc} 1 & 0 \cr 0 & 0 \end{array}\right))\quad -{1\over 2}({\Bbb P}^0 +i {\Bbb P}^3)({\Bbb D}=\left( \begin{array}{cc} c_\theta^2 & -c_\theta s_\theta\cr -c_\theta s_\theta & s_\theta^2 \end{array}\right))\cr &=& {1\over 2}\left( -i ({\Bbb P}^3({\Bbb D}_1) + {\Bbb P}^3({\Bbb D}_2)) +c_\theta s_\theta ({\Bbb P}^0 +i {\Bbb P}^3)({\Bbb D}_3) + s_\theta^2 ({\Bbb P}^0 +i {\Bbb P}^3)({\Bbb D}_2) \right); \end{eqnarray} } because of the presence of the ${\Bbb P}^0$'s it is now connected, by the action of the ${\Bbb T}^\pm$ generators of the gauge group (\ref{eq:action}), not only to pseudoscalar charged particles but to charged scalars. Consequently, aligning the strong and electroweak neutral pions unavoidably leads to charged electroweak mass eigenstates that are mixtures of scalars and pseudoscalars. Since we set aside this possibility from the beginning, \footnote{We rejected it for the sake of simplicity, not because it is uninteresting: it is left here as an open question, to be investigated in further works.} we see that, as soon as the Cabibbo rotation is operating, there is no way either for the $\pi^0$ to be an electroweak mass eigenstate. Note that a mass term $m^2 \Xi_1\otimes \Xi_1$ is not $CP$ invariant unless the one for $\Xi_2$ has the same coefficient; a crossed mass term $ m^2 \Xi_1\otimes \Xi_2$ is $CP$ invariant. The situation in the $K$ and $D$ sector is now even more intricate than in the case of a vanishing Cabibbo angle. The same construction as in the previous section can lead to electroweak mass eigenstates which are not $CP$ eigenstates, but these states now involve $\pi$ and $D_s$ mesons too, which cannot be disentangled from $K$ and $D$: in general, $CP$ violation cannot be restricted to the sole sector of $D$ and $K$ mesons. \section{Conclusion.} It it essentially made of open questions. The electroweak standard model for quarks is simple and extremely seducing but:\l -\quad it could be that it only describe a limited set among all the features of mesons and thus be too restrictive;\l -\quad if one adds to it a gauge theory of quarks and gluons \cite{MarcianoPagels}, the missing features could be thought to be hidden in the process of ``confinement''; but we are unable to solve it, and the remarks of Feynman at the beginning of his $1981$ paper \cite{Feynman} are still topical. In general, going to smaller and smaller substructures aims at a greater simplicity; this may however not be optimal, in particular when the gap deepens between the notion of ``fields'' and ``particles'', that is between what we compute and what we observe. We have given in previous works \cite{Machet1,Machet2,Machet3} and here an example of a gauge theory for $J=0$ mesons which is not only compatible with the $SU(2)_L \times U(1)$ standard model for quarks, but also richer without invoking quantum chromodynamics; it cannot pretend, of course, to describe mesons of higher angular momenta, for which compositeness is certainly appealing (though a Regge-like behaviour \cite{Regge} has not yet been attached to quantum chromodynamics either). But famous examples remind us that different descriptions of the same reality should not be thought to exclude each other but to concur towards a better understanding of observed phenomena. A very pressing question clearly concerns what is detected and measured in experiments, where all data are analyzed through the ``filter'' of a theoretical model; good compatibility with a given model does not exclude a better filter which would still improve the agreement. In this respect, I suggested in \cite{Machet3} that the custodial $SU(2)_V$ described there as directly related to the quantization of the electric charge could be found to be an exact symmetry if the data were analyzed not with the ``filter'' of the standard model for quarks, but with an electroweak gauge theory for mesons, in which the internal lines in the perturbative diagrams are also the propagators of asymptotic states. The suggestion made in the present work is that the nature of observed mesonic mass eigenstates may not yet be so well understood, specially as far as electroweak interactions are concerned: we have seen that, unlike what is expected, the latter strongly alter the $SU(4)$ classification of eigenstates; the mixture of scalars and pseudoscalars is left, too, as an open question. Our understanding of $CP$ violation is also modified by the point of view developed here: that it can take place for two generations demonstrates how much our description of reality depends on the model that we use to interpret the experimental data. \vskip 2cm \begin{em} \underline {Acknowledgments}: it is a pleasure to thank J. Avan for his careful reading of the manuscript. \end{em} \newpage\null \begin{em}
{ "redpajama_set_name": "RedPajamaArXiv" }
1,658
\section{Introduction} How galaxies form and evolve through cosmic time is one of the key questions of modern astronomy. In the context of hierarchical formation of structures in a cold dark-matter universe, less massive dark matter haloes form first, and then accrete to form more massive ones \citep[e.g.,][]{Diemand2011}. The star formation activity, however, is not simply proportional to the halo mass \citep[e.g.,][]{Somerville2015} nor constant over cosmic times \citep{Madau1998,Madau2014}. Hydro-cosmological simulations predict that massive galaxies tend to quench their star formation earlier and faster than less massive ones \citep{Zolotov2015}. Based on the Sloan Digital Sky Survey (SDSS, \citealt{York2000}) \citet{Citro2016} show that early-type massive galaxies follow an anti-hierarchical evolution (downsizing, \citealt{Cowie1996}), i.e. massive galaxies form and quench earlier. The star formation histories of the most massive galaxies reveal that they should have been formed by a vigorous star formation event, and have a compact configuration by $z\sim 2-3$. An important population of passively evolving massive galaxies is found to be already in place at $z\sim 2$ when the universe was only $\sim3$~Gyrs old \citep{Cimatti2004, Daddi2005, Trujillo2006, Damjanov2009, Whitaker2012, Cassata2013, HuertasCompany2013, HuertasCompany2015}. These high-redshift massive quiescent galaxies have been shown to be 3 to 5 times more compact than their local counterparts and have come to be commonly referred to as `red-nuggets' \citep{Daddi2005, Trujillo2006, Longhetti2007, Cimatti2008, VanDokkum2008, VanDokkum2010, Damjanov2009, Damjanov2011, Newman2010, Bruce2012, Ryan2012, Cassata2013, VanderWel2014}. It remains to be understood how these massive compact galaxies formed: what are their star-forming progenitors and what are the quenching processes involved to turn them into quiescent galaxies? Comparing the number density, stellar mass and size of the population of submillimeter galaxies (SMG) at high redshifts ($z \gtrsim 3$) to those of the population of compact massive quiescent galaxies at $z\sim 2$ in the COSMOS field, \citet{Toft2014} proposed a direct evolutionary connection between these two extreme galaxy types. Some of the SMGs in the process of quenching could be the ones observed by \citet{Barro2013} and \citet{VanDokkum2015} who have identified in the CANDELS fields high-redshift ($z>2$) star-forming progenitors with similar sizes ($\sim 1$\,kpc), masses ($\sim 10^{11}\,M_{\sun}$) and number densities to those of quiescent compact galaxies. Measuring star formation rates and gas content of their star-forming candidates, these authors underline the presence of a gas disc with sizes ranging from $\sim 0.2$ to 10\,kpc. Compaction is expected to be associated with a quenching episode \citep{Dekel2014, Zolotov2015}, where the more compact the star-forming massive galaxies become, the higher the probability is of them being quenched \citep{Williams2015, VanDokkum2015}. Although many of these works call for rapid quenching to form these compact massive quiescent galaxies, there is currently no consensus regarding the quenching mechanism. \citet{Barro2013}, \citet{ForsterSchreiber2014} and \citet{VanDokkum2015} find that close to half of the star-forming progenitors host active galactic nuclei (AGNs), but there is yet no direct evidence that the AGN is able to drive away the gas by itself \citep{Zolotov2015}. Environmental quenching \citep{Peng2010} may also be at play. Alternative models suggest that the origin of compact galaxies and subsequent size evolution might simply be a consequence of the size evolution of star-forming galaxies coupled with progenitor bias effects \citep[e.g.,][]{Carollo2013, Lilly2016}. Recent cosmological hydrodynamic simulations have contributed to our understanding of the evolution and formation of these compact massive galaxies. Taking into account a number of physical processes (e.g., gravity, hydrodynamics, gas cooling, star formation, stellar evolution, supernova and black hole feedback) and using subgrid models for feedback processes (e.g., \textsc{EAGLE}, \citealt{Schaye2015, Crain2015} and \textsc{ILLUSTRIS}, \citealt{Vogelsberger2014}) they seek to reproduce observed properties. Compact massive quiescent galaxies have indeed been identified in simulations at high redshifts \citep{Wellons2015, Zolotov2015, Furlong2015}, allowing us to trace back their formation history. \citet{Zolotov2015} find that the compaction of star-forming discs must be driven at a rate faster than the star formation rate. The compaction might be due to mergers (both minor and major) in concert with violent disc instabilities \citep[e.g.,][]{Dekel2014}. The onset of quenching happens when the galaxy is at its maximum compactness, due to gas depletion. Simulations show therefore that very compact passive galaxies are formed at high redshifts through dissipative process associated with gas inflow into the galaxy central region. As the efficiency of the quenching and compaction processes are correlated with the abundance of cold dense gas in the universe, the production of compact massive quiescent galaxies is expected to decrease with cosmic time. An alternative scenario to explain the shut-down of the star formation invokes the mechanism of `halo quenching' \citep[e.g.,][]{Zu2016}, in which the mass of the dark matter halo is the main driver for triggering the quenching. However, \citet{Woo2015} showed that galaxy compactness is playing a non-negligible role for satellite galaxy quenching. Both observations \citep[e.g.,][]{VanderWel2014} and cosmological hydrodynamic simulations \citep[e.g.,][]{Wellons2016} agree on the fact that massive early-type galaxies are smaller in median size at higher redshifts. This is partly due to the so-called progenitor bias, as star-forming galaxies have larger sizes at later times \citep{Mo1998}. An intrinsic growth of individual galaxies is expected and observed in numerical simulations, due e.g., to: (i) radial migration of stars, (ii) addition of mass to the outer region by mergers or accretion, and (iii) renewed star formation at larger radii. These channels of size evolution have been suggested to potentially lead the original compact massive quiescent galaxies to become the bulges of local galaxies \citep{Graham2015,DelaRosa2016}. These processes are however stochastic: one expects to see a decrease in numerical density of compact massive quiescent galaxies with redshift, leaving some relic candidates untouched. \citet{Wellons2016} and \citet{Furlong2015} studied the evolution of massive compact quiescent galaxies since high redshift using the \textsc{ILLUSTRIS} and the \textsc{EAGLE} simulations, respectively. On the one hand, \citet{Furlong2015} show that among the original population of compact massive and passive galaxies at $z=2$, 15\% remain central cores, 25\% become satellites, and 60\% merge with more massive systems at low redshifts. On the other hand, \citet{Wellons2016} observe that 14\% were consumed and accreted by more massive galaxies, 6\% experienced a major merger event and are partially disrupted, 49\% remained as the core of a more massive descendant, and 31\% remained untouched. The growth in size of galaxies with cosmic times is accompanied by a growth in mass that is dominated by ex-situ stars. \citet{Wellons2016} underline that even the undisturbed compact massive sample grows in mass and size. They also confirm the result obtained by \citet{Oser2012}, showing that the dominant accretion mode for simulated massive galaxies from $z\sim 2$ to present time is minor mergers with a mass-weighted mass ratio of 1:5. Despite the mean growth in size and mass of the high redshift population of massive compact quiescent galaxies, candidates that did not yet accrete large numbers of external stars and remained compact are expected to be found in the local universe. The current picture of (and search for) compact massive quiescent galaxies in the local universe is quite unclear. Depending on the definition of compactness and on the nature of the dataset, results are dramatically different. \citet{Trujillo2009} find almost no candidates using the SDSS DR6 NYU value-added galaxy catalogue (NYU VAGC, $z<0.2$), where they classify $0.03$\% of the population of massive ellipticals as relics. \citet{Valentinuzzi2010a} find, in turn, a large sample in the WIde-field Nearby Galaxy-cluster Survey ($0.04<z<0.07$) where $22$\% of the cluster members with masses in the interval $3\times 10^{10} < M_\star/M_{\sun} < 4\times 10^{11}$ are red nugget candidates. Based on the spectroscopic sample of SDSS DR7 \citet{Taylor2010} find a marked dearth of massive quiescent galaxies in the local universe ($0.066 < z < 0.12$) that are as compact as those at high redshifts. Adopting the same definition for compact relics as \citet{Valentinuzzi2010a}, \citet{Poggianti2013a} look for candidates in the field in the context of the Padova-Millennium Galaxy and Group Catalogue ($0.03 < z < 0.11$), and find three times less compact galaxies in the field than in cluster environments. \citet{Trujillo2014} identify a nearby galaxy, NGC 1277, as being one representative of the massive compact relics, with a mass of $1.2 \pm 0.4 \times 10^{11}\,M_{\sun}$ and a mean age of 12\,Gyr. Based on the same catalogue as \citet{Trujillo2009} but defining differently the compact relics, \citet{PeraltaDeArriba2016} find that galaxy clusters might be the preferred environments to find compact relics. Building a coherent picture that brings together the set of consistent observations at high redshifts with the discrepant ones locally calls for an analysis based on an intermediate redshift sample, as well as a common definition of the so-called local red nuggets. Such an analysis would provide insights on the evolution processes of the compact massive quiescent galaxy population over cosmic times. The main challenge of intermediate redshift studies is the chosen compromise between the area surveyed and the quality of the images, in order to have enough statistics on the one hand and to be able to disentangle stars from compact galaxies on the other. Space-based surveys sample limited volumes but benefit from exquisite image resolution, whereas ground based surveys can probe larger volumes but suffer from observational seeing limitations. Recent works using space-based data from HST found candidates for compact massive quiescent galaxies at intermediate redshifts in the COSMOS field \citep{Carollo2013,Damjanov2015} and in the ESO Distant Clusters Survey \citep{Valentinuzzi2010b}. Concerning ground based images, \citet{Damjanov2013} confirmed that non resolved galaxies of SDSS that are identified by their spectra present properties of compact quiescent candidates. \citet{Damjanov2014} extended this approach to data from the Baryon Oscillation Spectroscopic Survey (BOSS, \citealt{Eisenstein2011}) and derived the density evolution of compact massive candidates at intermediate redshifts, although with large error bars. Recently, \citet{Tortora2016} made use of the first and second releases of the ESO Public optical Kilo Degree Survey (KiDS) $-$ covering a region of $156$\,deg$^2$ in four bands $-$ and applying similar definitions as in \citet{Trujillo2009}, identified a population of compact relic candidates at intermediate redshifts; the number density of these objects appears to stay constant towards lower redshifts within the measured uncertainties. Although the authors do not observe any candidates at $z<0.2$, they attribute this to environment effects. In the present analysis we look for compact massive quiescent galaxies at intermediate redshifts (from $z=0.2$ to $z=0.6$) in the so-called Stripe 82 region. Thanks to uniform, deep, multiwavelength and weak lensing quality data over this large equatorial stripe, we are currently into a privileged position to look for the population of compact candidates. In this work, we adopt a spatially flat cosmological model with $\Omega_M = 0.3$, $\Omega_\Lambda = 0.7$ and $H_0=70$\,km\,s$^{-1}$\,Mpc$^{-1}$. Magnitudes are quoted in the AB system. \section{Identifying compact candidates in Stripe 82} The so-called Stripe~82 is an equatorial stripe of $\sim 250$\,deg$^2$ in the southern Galactic cap. It has been observed by the SDSS repeatedly as part of a supernova survey \citep[e.g.,][]{Abazajian2009} significantly increasing the depth $-$ compared to single-pass SDSS data $-$ in the survey footprint for all {\it ugriz } optical bands, ($i\sim 24.3$ for point like sources at $3\sigma$, \citealt{Annis2014, Jiang2014, Fliri2016}). Following these observations, this field has benefited from a wide coverage from radio wavelengths to X-rays and has thus become a favourite field for large-scale multiwavelength studies. We list here part of Stripe~82 observations to give an idea of the continuous inflow of new data: deep radio data by the Karl G. Jansky Very Large Array (VLA \citealt{Hodge2011,Mooley2016,Heywood2016}); microwave from the Atacama Cosmology Telescope (ACT, \citealt{Swetz2011}); submillimeter from the Herschel satellite \citep{Viero2014}; infrared (IR) from the Spitzer-IRAC instrument \citep{Papovich2016,Timlin2016}; near-infrared (NIR) from the Wide-Field Infrared Survey Explorer (WISE, \citealt{Wright2010}), the UKIRT Infrared Deep Sky Survey (UKIDSS, \citealt{Lawrence2007}) and from a joint VISTA-CFHT survey (Geach et al. in preparation); optical imaging from SDSS, the Subaru Hyper Suprime Cam \citep{Miyazaki2012, Aihara2017}, $i$-band CFHT data from CS82 (Kneib et al. in preparation), 12 optical bands from the S-PLUS survey (C. Mendes de Oliveira et al. in preparation), and X-rays from Chandra and XMM-Newton data \citep{LaMassa2016, Rosen2016}. In terms of spectroscopy, Stripe~82 has been targeted by various surveys, including the SDSS-III Baryon Oscillation Spectroscopic Survey \citep[BOSS,][]{Dawson2013} and SDSS-IV \citep{SDSSDR13}, the WiggleZ Dark Energy Survey \citep{Drinkwater2010}, the 2dF Galaxy and QSO Redshift Surveys \citep{2dFGRS,2QZ}, the 6dF Galaxy Survey \citep{6dF}, the Deep extragalactic Evolutionary Probe \citep[DEEP2,][]{DEEP2}, the VIMOS VLT Deep Survey \citep[VVDS,][]{Garilli2008}, the VIMOS Public Extragalactic Redshift Survey \citep[VIPERS,][]{VIPERS}, and the PRIsm MUlti-object Survey \citep[PRIMUS,][]{Coil2011}. Being observable from both south and north hemispheres, this area is becoming a preferred field for calibration purposes of large photometric surveys such as the Dark Energy Survey \citep{DES2016} and the Large Synoptic Survey Telescope project \citep{LSST2009}. \subsection{Datasets and catalogues\label{sec:datasets}} Different photometric redshift estimators have been applied to SDSS-Stripe~82 catalogues. \citet{Bundy2015} find that the best performances are obtained both using the red-sequence Matched-filter Probabilistic Percolation algorithm (redMaPPer, \citealt{Rykoff2014}), and a neural network approach as done by \citet{Reis2012} with ANNz \citep{Collister2004}. When photo-z's are not available from these catalogues, EAZY (for Easy and Accurate Redshifts from Yale, \citealt{Brammer2008}) estimates are used. The details of the photo-z catalogue are explained in \citet{Bundy2015}. In this work we give preference to spectroscopic over photometric redshift when available. In the NIR, UKIDSS \citep{Lawrence2007} targeted the Stripe~82 region, reaching $Y\sim 20$. We use the stellar masses and K-corrected colours from \citet{Bundy2015}\footnote{\url{http://massivegalaxies.com}}, which were obtained after applying the SYNthetic aperture MAGnitudes software ({\sc SYNMAGs}, \citealt{Bundy2012}) to match the photometry of SDSS coadd with UKIDSS, assuming a \citet{Chabrier2003} initial mass function. Considering that stellar mass estimates are more robust when using NIR data \citep{Courteau2014}, only objects that have at least one detection in one of the UKIDSS NIR bands ($Y$, $J$, $H$, and $K$) are considered for our analysis. We derived the morphological parameters based on the CFHT/{MegaPrime}\xspace Stripe~82 (CS82) survey. CS82 has been designed to provide high quality {\it i}-band imaging for a large fraction of the Stripe~82 region, suitable for weak lensing measurements (Kneib et al. in preparation). Due to the lensing specifications, an excellent image quality to a medium depth is required: the median seeing is $\sim 0\farcs 6$ and the limiting magnitude $mag_{\rm lim}\approx 24$ for a point-like source detection at 5$\sigma$. We run \textsc{SExtractor}\xspace\footnote{\url{http://www.astromatic.net/software/sextractor}} \citep[v2.18.8,][]{Bertin1996} and \textsc{PSFEx}\xspace\footnote{\url{http://www.astromatic.net/software/psfex}} \citep[v2.15.0,][]{Bertin2011} codes to characterize the morphology of all objects detected on the coadded images. Both codes have been designed to be run on large area images. \textsc{SExtractor}\xspace provides the morphological parameters by fitting defined brightness profiles, taking into account the point spread function (PSF) estimated by \textsc{PSFEx}\xspace. \textsc{PSFEx}\xspace and \textsc{SExtractor}\xspace were compared to the {\sc DAOPHOT} and {\sc ALLSTAR} software packages on simulated images by \citet{Annunziatella2013}. They find that \textsc{PSFEx}\xspace performs accurate PSF modeling. Both codes were also used by \citet{Desai2012} to produce a PSF corrected model-fitting photometry catalogue of the Blanco Cosmology Survey. The brightness profile of a galaxy is commonly fitted by the general S\'ersic parametrization which depends on the S\'ersic index $n_{\textrm{ser}}$. We fit four brightness profiles to the data: (1) a de Vaucouleurs ($n_{\textrm{ser}} = 4$) and (2) an exponential ($n_{\textrm{ser}} = 1$) profile, which respectively suit the brightness profiles of early and late-type galaxies, (3) a general S\'ersic profile and (4) a sum of a de Vaucouleurs and an exponential one. The morphological catalogue for the entire CS82 sample is based on the same approach (for details see Moraes et al. in preparation). PSF extraction is the cornerstone of our search of compact elliptical galaxies. \textsc{PSFEx}\xspace performances are assessed in Moraes et al. (in preparation) by comparing the galaxy ellipticities recovered by \textsc{PSFEx}\xspace and \textsc{SExtractor}\xspace with the ellipticities obtained with the {\it lensfit} Bayesian shape measurement algorithm \citep{Heymans2012, Miller2013}, which we consider as a benchmark. For the ellipticities of PSF-sized galaxies we find a mean bias of $\sim 0.01 \pm 0.05$. For galaxies with sizes below the PSF, \textsc{PSFEx}\xspace and \textsc{SExtractor}\xspace still allow to recover the correct ellipticities, but within a larger error bar: $\sim 0.04\pm 0.12$. Size estimates based on \textsc{PSFEx}\xspace and \textsc{SExtractor}\xspace for galaxies whose angular size is close to the PSF are discussed in section~\ref{sec:sizecheck}. We measure the effective radii of the galaxies in the $i$-band. The pivot wavelength of the $i$ band corresponds to restframe wavelengths of 635~nm and 477~nm at redshifts $z=0.2$ and $z=0.6$, respectively. According to \citet{Kelvin2012}, the morphological K-correction resulting within this wavelength range is of the order of $\sim 0.1$~kpc for a spheroidal galaxy with an effective radius of 1~kpc, and of the order of $\sim 0.3$~kpc for an effective radius of 3~kpc. This 10\% effect on the effective radius is of the order of the measurement error from \textsc{SExtractor}\xspace. \subsection{Sample selection \label{sec:samplesel}} \begin{figure} \includegraphics[width=84mm]{fig1.eps} \caption{Colour-colour diagram illustrating the bimodal distribution of galaxies: star-forming late-types and quiescent early-types occupy two distinct regions within this diagram. The red line shows the adopted separation between the two populations in order to select quiescent objects. The green regions represent $\sim60,000$~objects in the redshift range $0.2 < z < 0.3$, where no stellar mass cut has been applied. The colours have been K-corrected.} \label{fig:quiescent} \end{figure} The present analysis focuses on the population of massive passive galaxies at intermediate redshifts. The way in which compact massive quiescent galaxies are selected, in particular the definition of compactness and of the lower limit used for the mass, has a great influence on the derived sample \citep[e.g.,][]{Damjanov2015}. We adopt different definitions following a set of different selection criteria that have been used by other authors in an effort to make reliable comparisons with a broad range of previous studies \citep{Quilis2013, Carollo2013, VanderWel2014, VanDokkum2015}. We describe below the adopted cuts in redshift ($z$), stellar mass ($M_{\star}$) and colours: \begin{enumerate} \item $0.2 < z < 0.6$. We are interested in the evolution of the population of massive galaxies between high and low redshifts. The limits have been set to fill the gap between these two regimes, following \citet{Damjanov2013}. Moreover our photometric redshift catalogue is reliable out to $z \sim 0.6$. \item $\ensuremath{\log_{10}}(M_{\star}/M_{\sun}) > \ensuremath{\log_{10}}(M_\textrm{min}/M_{\sun})$. We note that to avoid contamination from star-forming galaxies, \citet{Moresco2013} recommend a cut of $\ensuremath{\log_{10}}(M_\textrm{min}/M_{\sun}) = 10.75$, independently of the selection criteria to separate passive galaxies. For this reason we have decided not to include a comparison with \citet{Barro2013} and \citet{Poggianti2013a}, as they selected massive galaxies with a minimal mass of $\ensuremath{\log_{10}}(M_\textrm{min}/M_{\sun}) = 10$ and $10.3$, respectively. In the present analysis, we follow the definitions of \citet{Quilis2013}: $\ensuremath{\log_{10}}(M_\textrm{min}/M_{\sun}) = 10.9$ (corresponding to $M_\textrm{min} = 8\times 10^{10}\,M_{\sun}$); \citet{Carollo2013}: $\ensuremath{\log_{10}}(M_\textrm{min}/M_{\sun}) = 10.5$; \citet{VanderWel2014}: $\ensuremath{\log_{10}}(M_\textrm{min}/M_{\sun}) = 10.7$ and \citet{VanDokkum2015}: $\ensuremath{\log_{10}}(M_\textrm{min}/M_{\sun}) = 10.6$. \item The use of the colour bimodality to separate early-type quiescent galaxies from late-type star-forming ones has been first underlined by \citet{Strateva2001} and \citet{Baldry2004}. In more recent analyses, \citet{Wuyts2007}, \citet{Williams2009}, \citet{Whitaker2011} and \citet{Muzzin2013} have worked in the rest frame colours $u-V$ vs. $V-J$. We follow their approach, applying adapted cuts for each redshift bin, defining four slices of $\Delta z =0.1$ between $z=0.2$ and $z=0.6$. To obtain the rest frame colours, a K-correction has been applied following the methodology of \citet{Chilingarian2010}. As an example, we show in Figure~\ref{fig:quiescent} how quiescent galaxies within the redshift bin $0.2 < z < 0.3$ are selected based on a cut defined to roughly match the local minima between the two peaks in the $u-i$ vs. $i-K$ colour-colour galaxy distribution. For the redshift range $0.3 < z < 0.6$, we choose $g-i$ for the y-axis. This ensures these colours encompass the rest-frame 4000\,$\mbox{\normalfont\AA}$ break, which strongly correlates with the age of the stellar population \citep[e.g.,][]{Martin2007, Goncalves2012}. According to the availability of the NIR bands from UKIDSS, we changed the x-axis to $i-H$ or $i-Y$. \end{enumerate} \subsection{Star/galaxy separation} Considering that we are searching for compact galaxies that may resemble point-like sources, it is of major importance to have an accurate star/galaxy discriminator. We base our star/galaxy discrimination on CS82 data for a first sorting based on a morphological approach using \textsc{SExtractor}\xspace. We further refine our discrimination with colour information from SDSS and UKIDSS. \textsc{SExtractor}\xspace in its model-fitting feature provides the \texttt{SPREAD\underline{~}MODEL}\xspace parameter that estimates the similarity of the brightness profile of an object to the image PSF (see eq.~5 of \citealt{Desai2012}). The distribution of \texttt{SPREAD\underline{~}MODEL}\xspace as a function of the \textsc{SExtractor}\xspace \texttt{MAG\underline{~}AUTO}\xspace Kron magnitude is shown in Figure~\ref{fig:spreadmodel} for one coadded pointing (which we refer to as {\it tile}) of the CS82 survey that has been masked to remove bright saturated stars and PSF discontinuities from the analysis (see section~\ref{sec:effarea}). We show that the stellar branch, for which \texttt{SPREAD\underline{~}MODEL}\xspace~$\sim 0$, is clearly separated from values for extended objects out to \texttt{MAG\underline{~}AUTO}\xspace~$\la 22.5$. \begin{figure} \includegraphics[width=\columnwidth]{fig2.eps} \caption{Distribution of the \texttt{SPREAD\underline{~}MODEL}\xspace \textsc{SExtractor}\xspace parameter as a function of the Kron magnitude \texttt{MAG\underline{~}AUTO}\xspace for one tile of the CS82 survey. A gaussian function has been fitted to the \texttt{SPREAD\underline{~}MODEL}\xspace histogram of the stellar branch, and values greater than three sigma above that are defined as extended (green stars).} \label{fig:spreadmodel} \end{figure} \begin{figure} \includegraphics[width=84mm]{fig3.eps} \caption{$Y-K$ vs. $g-Y$ colour-colour diagram used to refine our star/galaxy separation. Blue regions show the locus of high S/N stars ($\textrm{S/N}>10$), whereas red regions indicate all massive quiescent galaxies ($M > 5\times 10^{10}\,M_{\sun}$) with redshifts between 0.2 and 0.6. MCQ galaxies stands for massive compact quiescent galaxies.} \label{fig:starselection} \end{figure} For each tile we fit a Gaussian function to the stellar branch, and consider as point-like those objects with a value of \texttt{SPREAD\underline{~}MODEL}\xspace lower than three standard deviations from the mean of the Gaussian (see Figure~\ref{fig:spreadmodel}). We note that the median seeing of the CS82 survey ($0\farcs 6$) is smaller than the median seeing of the SDSS\footnote{\url{http://www.sdss.org/dr12/imaging/other_info/}} ($\sim 1\farcs 43$). \citet{Damjanov2013} showed that some compact galaxies are morphologically identified as stars by SDSS. We have checked that the only object of \citet{Damjanov2013} that lies in Stripe~82 has been well classified as an extended-like object using the procedure described above. However, it is not considered in our analysis due to a stellar mass of $\ensuremath{\log_{10}} (M_{\star}) = 9.95$, below our mass cut selection. We use colour information from both SDSS and UKIDSS to remove misclassified stars from the sample of extended objects. Following \citet{Whitaker2011}, the rest frame colours $u-J$ and $J-K$ are well adapted for a star/galaxy separation. Figure~\ref{fig:starselection} shows the colour-colour diagram $g-Y$ and $Y-K$ of passive massive galaxies with redshifts $0.2 < z < 0.6$ (red regions). The stars selected with the morphological approach are shown in blue contours. Both datasets are clearly separated in this diagram. We define the separation between stars and galaxies by fitting a gaussian function of the projected histogram of the stellar cloud onto the y-axis, allowing for a $2\sigma$ variation. When the $Y$ or $K$~bands were not available, we carried out the separation using $g-J$/$J-K$, $g-H$/$H-K$ and $g-Y$/$Y-H$ colour diagrams, with the caveat that in the two last sets the separation between stars and galaxies is not as clear. For the subset of galaxies with spectroscopic data $-$ identified as galaxies based on their spectral features $-$ we verified that their colours placed them in the ``galaxy region'' of the diagrams. We removed $2.6$\% of the objects of the quiescent catalogue (2,447 out of 94,596) with this extra criterion. \subsection{Compactness criteria \label{sec:compact}} As mentioned earlier, we follow the definitions of compactness adopted by \citet{Quilis2013}, \citet{Carollo2013}, \citet{VanderWel2014} and \citet{VanDokkum2015}. While \citet{Carollo2013} and \citet{VanderWel2014} opt for a criterion based on the non-circularized effective radius $R_\textrm{eff}$, the other authors use the circularized effective radius $R_\textrm{eff,c} = R_\textrm{eff} \times \sqrt{b/a}$, where b and a are the minor and major axis of the model ellipse containing half of the total flux, respectively. The criteria for a galaxy to be considered as compact by the different authors $-$ and that we integrate into our analysis $-$ are summarized here: \begin{enumerate} \item \citet{Quilis2013}: $R_\textrm{eff,c} < 1.5$\,kpc; \item \citet{Carollo2013}: we focus on the two lowest size bins of their Figure~4, for which the compact definitions correspond to $R_\textrm{eff} < 1.4$\,kpc and $R_\textrm{eff} < 2.0$\,kpc, respectively; we refer to these definitions in Table~\ref{tab:numberscompact} and Figure~\ref{fig:density} as the `most' and `less' compact criteria, respectively; \item \citet{VanderWel2014}: \begin{equation} R_\textrm{eff} < A \times \left( M_\star/10^{11}\,M_{\sun} \right)^{0.75} \; , \end{equation} where $A=1.5$\, kpc or $2.5$\,kpc following the most conservative (red dashed line in Figure~\ref{fig:compactreff}) and the loosest (black short-dashed line) criteria of compactness, respectively; \item \citet{VanDokkum2015}: \begin{equation} R_\textrm{eff,c} < 2 {\rm ~kpc} \times \left( M_\star/10^{11}\,M_{\sun} \right) \; . \end{equation} \end{enumerate} \begin{figure} \includegraphics[width=84mm]{fig4.eps} \caption{Galaxy size - stellar mass relation in four redshift bins. The quiescent galaxies are shown in red, whereas the most compact ones $-$ according to the strictest criterion of \protect\citet{VanderWel2014} $-$ are shown as indigo stars. The gray line is a linear fit to the distribution of quiescent galaxies in red; to compare we show the fit to the SDSS size distribution by \protect\citet{Shen2003} with the black dot-dashed line. Dashed red and black lines show the `most' and `less' compact criteria by \protect\citet{VanderWel2014}, respectively. For clarity, we only plot the most compact objects according to the \citet{VanderWel2014} criterion and error bars are only shown for the first redshift bin.} \label{fig:compactreff} \end{figure} To characterize the size of our sample we use the effective radius measurement from the de Vaucouleurs fit of CS82 data using \textsc{SExtractor}\xspace and \textsc{PSFEx}\xspace{}. Furthermore, following the same colour selection to separate quiescent and star-forming galaxies as we do in the current analysis, \citet{VanderWel2014} ended up with a quiescent sample for which $80$\% of their S\'ersic index was larger than 2.5. The galaxy size vs. stellar mass distribution for massive quiescent galaxies is shown in Figure~\ref{fig:compactreff} for four redshift bins in the range of $0.2 < z < 0.6$. The error on the effective radius in kpc ($R_\textrm{eff}$) reflects the uncertainty on the redshift and on the measured effective radius in arcseconds ($r_{\textrm{eff}}$); that is, $\delta R_\textrm{eff}$\,(kpc)\,$= \left( \delta r_{\textrm{eff}}/r_{\textrm{eff}} + \delta z/z \right) \times R_\textrm{eff}$. The error in stellar mass comes from the derivation of the mass with the SYNMAG code. We verified that our size distribution in the lowest redshift bin reproduced the fit performed by \citet{Shen2003} on SDSS data (see Figure~\ref{fig:compactreff}). We confirm the trend of decreasing sizes of early-type galaxies in the past \citep[e.g.,][]{VanderWel2014,Furlong2015}. Although not all compactness criteria are shown here, the resulting samples behave similarly. The percentage that compact galaxies represent within the total massive quiescent population is shown as a function of redshift in Figure~\ref{fig:percentage}. Depending on the compactness definition considered, the compact population accounts for merely a few percent up to 25\% of all massive quiescent galaxies. \begin{figure} \includegraphics[width=\columnwidth]{fig5.eps} \caption{Redshift evolution of the percentage that compact massive quiescent galaxies represent within the general population of massive quiescent galaxies within the redshift range considered in our study (0.2<z<0.6). We show our results considering the different compactness criteria defined in section~\ref{sec:compact} and adopt Poisson error bars.} \label{fig:percentage} \end{figure} \section{The catalogue of compact candidates} \begin{table} \caption{Number of massive quiescent galaxies above different minimum masses ($M_{\textrm{min}}$) as defined by the different definitions adopted (C13: \citealt{Carollo2013}; vD15: \citealt{VanDokkum2015}; vdW14: \citealt{VanderWel2014}; QT13: \citealt{Quilis2013}). `Most' and `less' refer to the most and less compact criteria (when it applies) as presented in section~\ref{sec:compact}. The fourth column shows the number of massive compact quiescent candidates selected for each definition, and its respective percentage of galaxies having SDSS spectra.} \label{tab:numberscompact} \begin{tabular}{cclc} \hline $M_{\textrm{min}}$ & \# & compact & \# compact \\ $\ensuremath{\log_{10}}(M/M_{\sun})$ & quiescent & definition & (with spectra)\\ \hline $10.5$ & 78,493 & C13 most & 2,381 (0.3\%)\\ & & C13 less & 9,766 (0.6\%)\\ $10.6$ & 71,408 & vD15 & 9,818 (23\%)\\ $10.7$ & 62,515 & vdW14 most & 424 (8\%)\\ & & vdW14 less & 6,596 (18\%) \\ $10.9$ & 40,218 & QT13 & 1,103 (2\%) \\ \hline \end{tabular} \end{table} We provide in Table~\ref{tab:numberscompact} the number of massive quiescent galaxies and the number of compact ones corresponding to each definition of compactness \citep{Quilis2013, Carollo2013, VanDokkum2015, VanderWel2014}. The percentage of compact candidates that have SDSS spectra is shown. Within this section we only consider the catalogues obtained using the \citet{VanderWel2014} definitions for compactness (most and less conservative ones), as illustrative examples of our analysis; the final results in sections~\ref{sec:completeness} and \ref{sec:results} are shown for all compactness definitions mentioned in section~\ref{sec:compact}. Using the CS82 morphological data, we end up with 424 massive quiescent candidate galaxies for the most compact criterion and 6596 candidates for the less compact one. \subsection{Morphological properties \label{sec:morphoproperties}} Two of the authors (AC and EG) visually inspected each of the most and less compact candidates, examining each object, its reconstructed morphological model and the residuals of the model-fitting. They agree on the following classification within an error of $\sim 3$\% among the two and find that: \begin{enumerate} \item $\sim 82$\% have a typical elliptical shape and good residuals; \item $\sim 11$\% have bad residuals due to close neighbours. \textsc{SExtractor}\xspace is currently not able to handle a simultaneous fit of various objects: pixels of the segmentation maps are attributed to only one object, even if receiving signal from two sources; \item $\sim 7$\% have bad residuals due to the non adequacy of the de Vaucouleurs shape to fit the galaxy brightness profile. \end{enumerate} We checked that the colours of these three categories were equally distributed in the colour-colour diagram used for the star-forming/quiescent separation. In addition to the de Vaucouleurs brightness profile, we fit a general S\'ersic profile to all the objects using \textsc{SExtractor}\xspace. We present in Figure~\ref{fig:morphofit} the S\'ersic index distribution as a function of the aspect ratio (axial ratio of the best-fitting model) for the sample of most and less compact galaxies in red contours and blue colours, respectively (most compact galaxies are included in the less compact sample). Our most and less compact massive quiescent candidates have a high median S\'ersic index ($<n_{\textrm{ser}}>=6.9$ and $<n_{\textrm{ser}}>=5.2$, respectively) characteristic of early-type galaxies ($n_{\textrm{ser}}\geqslant 2.5$); they also present a roundish shape, with a median aspect ratio of $<b/a>=0.66$ and $<b/a>=0.71$, respectively. \begin{figure} \includegraphics[width=84mm]{fig6.eps} \caption{Distribution of the S\'ersic index as a function of the aspect ratio of the selected compact passive galaxies, extracted from a fit by a general S\'ersic brightness profile. The blue 2D-histogram shows the less compact sample, whereas the red contours represent the most compact candidates. We notice that most compact galaxies are included in the less compact sample.} \label{fig:morphofit} \end{figure} \subsection{Verifying the size estimates \label{sec:sizecheck}} Our selection of compact galaxies relies on size estimates extracted from ground-based images. There are essentially two main sources of errors: statistic, i.e the ability of the method to recover effective radii generally smaller than the PSF, and systematic, i.e. the uncertainties due to a wrong model assumption. We are indeed using a de Vaucouleurs profile to fit the surface brightness profile of our galaxies. This can induce a systematic error if the model does not properly match the actual galaxy profile \citep[e.g.,][]{Yoon2011, Bernardi2013, Bernardi2017}. The robustness of the \textsc{PSFEx}\xspace and \textsc{SExtractor}\xspace packages in deconvolving the PSF and in estimating the galaxy sizes has to be assessed. We have created simulated images with similar properties to a CS82 coadd image using the \textsc{SkyMaker}\xspace\footnote{\url{http://www.astromatic.net/software/skymaker}} package \citep{Bertin2009}. The gain, exposure time, sky background, seeing and telescope properties were set to be equal to the CS82 ones. The catalogue of morphological properties of a CS82 tile is given as input for \textsc{SkyMaker}\xspace: objects classified as stars in CS82 catalogues are added as PSFs, whereas the properties of all other objects are from our model-fitting. We have created an image containing only stars and pure de Vaucouleurs galaxies, and an image with a large variety of bulge plus disk luminosity profiles modelled by a combination of an exponential and a de Vaucouleurs components. The first set of simulations should allow one to quantify the statistical error (assuming that the model is correct). The second set allows us to estimate the systematic uncertainty arising from using a wrong model to fit the galaxies. The simulated images contain an average of $\sim\,$65,000 objects. We have run \textsc{PSFEx}\xspace and \textsc{SExtractor}\xspace packages on these simulated images using the same pipeline as for real CS82 images assuming a pure de Vaucouleurs profile. The comparison of the sizes from the input catalogues and the recovered ones is shown in Figures~\ref{fig:deVdeltaReffMag} and \ref{fig:deVdeltaReff} for an image containing only pure de Vaucouleurs profiles, and in Figures~\ref{fig:deVexpdeltaReffchi2} and \ref{fig:deVexpdeltaReff} for an image containing composite brightness models. \begin{figure} \includegraphics[width=84mm]{fig7.eps} \caption{Relative error on the effective radius as a function of the magnitude of the galaxy. The simulated image contains only pure de Vaucouleurs profiles and is fitted by pure de Vaucouleurs models. Grey area shows the distribution of the 90th percentile of compact candidates selected according to the loosest criterion of \citet{VanderWel2014}.} \label{fig:deVdeltaReffMag} \end{figure} \begin{figure} \includegraphics[width=84mm]{fig8.eps} \caption{Relative error on the effective radius as a function of the effective radius of the simulated galaxy. The simulated image contains only pure de Vaucouleurs bulges, and is fitted by pure de Vaucouleurs models. The grey area is defined as in Figure~\ref{fig:deVdeltaReffMag}. The vertical dashed line shows the input seeing of the simulated image.} \label{fig:deVdeltaReff} \end{figure} The grey area shows the 90th percentile of compact candidates identified with the loosest criterion of \cite{VanderWel2014}. Points and error bars represent median values and 90th percentiles of the sample defined by $i < 22$ and $r_{\textrm{eff}} < 2$\,arcsec\footnote{$r_{\textrm{eff}}$ is the effective radius $R_\textrm{eff}$ (kpc) in arcsec}, containing $\sim\,$9,700 galaxies. We define the relative error on the effective radius as the relative difference between the recovered radius and the radius provided to create the simulated image: $\delta r_{\textrm{eff}}/r_{\textrm{eff}} = (r_{\textrm{eff}} (modelled) - r_{\textrm{eff}} (simulated))/r_{\textrm{eff}} (simulated)$. For the image created with pure de Vaucouleurs profiles and fitted by pure de Vaucouleurs models, we find that the relative error depends only weakly on the magnitude of the objects (see Figure~\ref{fig:deVdeltaReffMag}). We observe a systematic negative offset varying from $5$ to $1$\% for smaller (0,2\,arcsec) to larger galaxies (0,9\,arcsec), however compatible with 0 (see Figure~\ref{fig:deVdeltaReff}). This offset suggests that we are underestimating the size of the galaxies at the $\sim 2-5$\% level if the galaxy is effectively a pure bulge. \begin{figure} \includegraphics[width=84mm]{fig9.eps} \caption{Relative error on the effective radius as a function of the \textsc{SExtractor}\xspace $\chi^2$ of the fit. The simulated image contains composite profiles described by a sum of an exponential disk and a de Vaucouleurs bulge and is fitted by pure de Vaucouleurs models. The colors vary with the B/T flux ratio.} \label{fig:deVexpdeltaReffchi2} \end{figure} \begin{figure} \includegraphics[width=84mm]{fig10.eps} \caption{Relative error on the effective radius as a function of the effective radius of the simulated galaxy. The simulated image contains composite profiles described by a sum of an exponential disk and a de Vaucouleurs bulge and is fitted by pure de Vaucouleurs models. The colors vary with the B/T flux ratio. The Grey area as is defined in Figure~\ref{fig:deVdeltaReffMag}. The vertical dashed line shows the input seeing of the simulated image.} \label{fig:deVexpdeltaReff} \end{figure} On the other hand if the galaxy is a sum of two components, a bulge plus a disk, the quality of the fit by a pure de Vaucouleurs profile is strongly dependent on the bulge-to-total (B/T) flux ratio. The $\chi^2$ of the \textsc{SExtractor}\xspace model is not normalized to 1, but indicates better fit for $\chi^2 \sim 0.85$. Figure~\ref{fig:deVexpdeltaReffchi2} shows the increase of the $\chi^2$ with the decrease of the B/T ratio. The relative error on the effective radius is directly related to the B/T ratio: for $\textrm{B/T}<0.5$, the relative error becomes larger than $50$\%. Figure~\ref{fig:deVexpdeltaReff} illustrates the dependence of $\delta r_{\textrm{eff}}/r_{\textrm{eff}}$ on the input size of the galaxy. The effective radius is overestimated whatever the B/T ratio for the range of compact galaxy sizes (except for pure small bulges). For $\textrm{B/T}>0.75$, the error reaches $\sim 30$\%. It means that if a compact galaxy is not a pure de Vaucouleurs bulge and has another component, our methodology tends to overestimate the size. As discussed in section~\ref{sec:conclusion}, this will impact our results in the sense that we might lose a fraction of the compact candidates. If the error on the galaxy size estimate is systematic at the level of 5\%, with all other equal parameters, this would lead to an increase of $33$\% and $28$\% in the number density of the most and less compact galaxies, respectively. Therefore, if anything, the measured number densities are underestimated. Accounting for this error makes our conclusions even stronger. \begin{figure} \includegraphics[width=84mm]{fig11.eps} \caption{Compact massive quiescent galaxies that have been observed by both CS82 (first, fourth, seventh and tenth lines) and HST/ACS (second, fifth, eighth and tenth lines) in $i$-band. The images are centred on the galaxy of interest. The residuals of the fitting of the HST images by a de Vaucouleurs brightness profile are shown (third, sixth, ninth and tenth lines). The cutouts are north-oriented, with a side size of $10\arcsec$. An inset bar indicates the size of 5\,kpc at the redshift of the galaxies.} \label{fig:hstimages} \end{figure} We also checked the reliability of the PSF deconvolution by the \textsc{PSFEx}\xspace package by comparing the results with space based images of higher quality. We collected HST images taken with the Advanced Camera for Surveys (ACS) Wide field Channel (WFC) in the $i$-bands (nominally the F814W and F775W filters) from the Hubble Legacy Archive.\footnote{\url{http://hla.stsci.edu}} Thirteen of our massive compact candidates within the less conservative sample have been covered by HST. The images come from different observing programs and their exposure time varies between $1{,}000$ and $7{,}866$~seconds, corresponding respectively to depths of $\sim 23.5$ and $24.5$ in $i$-band for extended sources. We estimated the morphological parameters by running \textsc{SExtractor}\xspace and \textsc{PSFEx}\xspace on each HST image. All compact candidates are indeed extended objects (i.e., not stars), as shown in Figure~\ref{fig:hstimages}. The redshifts indicated in boxes are spectroscopic (SDSS/BOSS) for four of them (the ones with $z=0.4, 0.47, 0.56$ and the second in the row with $z=0.55$), and photometric for the remaining nine. We compare the morphological outputs from \textsc{SExtractor}\xspace obtained by fitting a de Vaucouleurs profile on both sets of images (see Figure~\ref{fig:hstcs82}). The photometry and the morphology extracted from both CS82 and HST/ACS data are in very good agreement. We report a mean squared difference of $0.10$ in magnitude and of $0.4$\,kpc for the effective radius. We do not identify clear systematics due to the larger PSF of CS82 images and we verify the robustness of the PSF deconvolution by the \textsc{PSFEx}\xspace code. The \texttt{SPREAD\underline{~}MODEL}\xspace parameters derived from the HST images are larger than the CS82 as the galaxies are clearly resolved as extended sources. \begin{figure} \includegraphics[width=84mm]{fig12.eps} \caption{Comparison of the morphological and photometric properties of the compact galaxies that have been observed both by CS82 and HST. The parameters were derived by fitting a de Vaucouleurs brightness profile using \textsc{SExtractor}\xspace and \textsc{PSFEx}\xspace: model magnitude (upper left), aspect ratio $b/a$ (upper right), effective radius $r_\textrm{eff}$ (lower left) and the \texttt{SPREAD\underline{~}MODEL}\xspace parameter (lower right). The colour scale indicates the redshift.} \label{fig:hstcs82} \end{figure} \section{Number density evolution} \subsection{Effective area \label{sec:effarea}} One characteristic that sets this study aside from other works \citep[e.g.,][]{Valentinuzzi2010a, Valentinuzzi2010b, Poggianti2013a, Damjanov2014, Tortora2016} is the uniform coverage of a large contiguous region of the sky, without pre-selection based on the environment. To calculate the evolution of the density of compact galaxies with redshift, we first estimate the area covered by the CS82 survey. We combined the masks of UKIDSS and CS82 using the \textsc{WeightWatcher}% \footnote{\url{http://www.astromatic.net/software/weightwatcher}} and \textsc{SWarp}\footnote{\url{http://www.astromatic.net/software/swarp}} packages. \textsc{WeightWatcher} is designed to combine weight maps, flag maps and polygons, whereas \textsc{SWarp} re-samples and coadds FITS images. The CS82 and UKIDSS masks were produced to remove bright stars, cosmic rays and artefacts. Considering that CS82 images are built from four single exposures, dithered to fill the gap between CCD chips and that our method is sensitive to PSF discontinuities that appear in these regions, we omit from our search the $\sim 33$\% of the total area corresponding to these interstitial regions. We show a portion of the total mask in Figure~\ref{fig:masks}: the horizontal and vertical lines correspond to the inter-CCD regions. We have measured an effective area of $A_{\textrm{eff}} = 82.6 \pm 7.3$\,deg$^2$. \begin{figure} \begin{center} \includegraphics[trim={15 3 15 3},clip,width=84mm]{fig13.ps} \end{center} \caption{Combined masks from CS82 and UKIDSS in a portion of Stripe~82 for the estimate of the effective area.} \label{fig:masks} \end{figure} \subsection{Completeness \label{sec:completeness}} Our sample of compact massive quiescent galaxies suffers incompleteness at the low mass end due to the magnitude limit of the NIR data (optical data are deeper). We derive a corresponding 80\% completeness magnitude limit in $i$-band of $\sim 20.5$ for extended sources by looking at the inflection in the number counts in the $i$-band. This magnitude limit in $i$-band corresponds to an increasing limiting stellar mass at increasing redshifts, above which we consider that the sample of quiescent galaxies is complete. The limiting stellar mass is defined as in \citet{Pozzetti2010}: for each bin of redshift in $z=[0.2,0.3,0.4,0.5,0.6]$ we compute the upper envelope of the limiting mass distribution for 95\% completeness and find $10.2$, $10.5$, $10.9$ and $11.2$ (in $\ensuremath{\log_{10}} M_\star /M_{\sun}$), respectively. These values are represented by vertical lines in Figure~\ref{fig:massfunction} and summarized in Table~\ref{tab:lossfactor}. \begin{figure} \includegraphics[width=84mm]{fig14.eps} \caption{Galaxy stellar mass functions (GSMF) in four bins of redshift between $z=0.2$ and $z=0.6$. Blue upper point represent the quiescent selections, lower red and middle black points show the most and less compact massive candidates obtained adopting the \citet{VanderWel2014} criteria, respectively. Vertical magenta dash-dotted lines show the limiting mass above which the quiescent sample is complete. Blue dashed lines are double Schechter functions fitted to quiescent GSMF data, whose parameters are taken from \citet{Ilbert2013}. In the case of the first panel, the vertical line lies at smaller values than the stellar mass range.} \label{fig:massfunction} \end{figure} We compute the galaxy stellar mass function (GSMF) following the $V_{\rm max}$ method \citep{Schmidt1968, Baldry2008}: \begin{equation} \Phi_{\ensuremath{\log_{10}} M} = \frac{1}{\Delta \ensuremath{\log_{10}} M} \sum\limits_{j} \frac{1}{V_{\rm max, j}} \, , \end{equation} where $\Delta \ensuremath{\log_{10}} M$ is the mass bin in logarithmic scale. $V_{\rm max, j}$ is the comoving volume over which the $j$th galaxy could be observed and is computed given the redshift of the galaxy and the limiting magnitude of the survey ($21.0$ in $i$-band magnitude at $50$\% completeness). Our quiescent GSMF is shown in Figure~\ref{fig:massfunction} as blue stars in different redshift bins. To estimate how much of the passive galaxy population we are losing at higher redshift towards the lower masses, we assume that the shape of the GSMF does not vary significantly between $z=0.2$ and $z=0.6$, and that we can simply renormalise the double Schechter function provided by \citet{Ilbert2013}. This renormalization is shown as blue dashed lines in Figure~\ref{fig:massfunction}, where we have only included in the fit the data points that are above the limiting mass. We define the completeness factor as the ratio of the number of detected galaxies over the number of expected galaxies according to the Schechter function. Completeness factors computed for different minimum stellar masses ($10^{10.5}$, $10^{10.6}$, $10^{10.7}$ and $10^{10.9}\,M_{\sun}$) are summarized in Table~\ref{tab:lossfactor}. We find that we are complete towards lower redshifts where completeness factors are close or equal to one for all the chosen minimum stellar masses of our samples. We miss less massive galaxies in number counts at higher redshifts: for the bin $0.5<z<0.6$ our selection of quiescent galaxies is complete at 57\% above $10^{10.5}\,M_{\sun}$ and at 80\% above $10^{10.9}\,M_{\sun}$. \begin{table} \caption{Limiting stellar mass, for each redshift bin, above which the sample of quiescent galaxies is complete, and factor of completeness for subsets of galaxies above a given minimum stellar mass ($10^{10.5}$, $10^{10.6}$, $10^{10.7}$ and $10^{10.9}\,M_{\sun}$).} \label{tab:lossfactor} \begin{tabular}{lccccc} \hline z bin & limiting mass & \multicolumn{4}{c}{completeness factor} \\ & $\ensuremath{\log_{10}}(M_\star /M_{\sun})$ & \multicolumn{4}{c}{for $\ensuremath{\log_{10}}(M_\star /M_{\sun})$}\\ & & $> 10.5$ & $> 10.6$ & $> 10.7$ & $>10.9$ \\ \hline 0.2-0.3 & 10.18 & 1 & 1 & 0.99 & 0.97 \\ 0.3-0.4 & 10.54 & 1 & 0.99 & 0.97 & 0.96 \\ 0.4-0.5 & 10.91 & 0.73 & 0.84 & 0.95 & 1 \\ 0.5-0.6 & 11.21 & 0.57 & 0.59 & 0.63 & 0.80 \\ \hline \end{tabular} \end{table} We take into account these completeness factors in the estimate of the number densities that are shown on Figures~\ref{fig:density} and~\ref{fig:densitysimulations} where the raw number count of compact quiescent galaxies above a given stellar mass in a given redshift bin is divided by the appropriate completeness factor taken from Table~\ref{tab:lossfactor}. We have calculated the influence of the slope of the GSMF at the low mass end on the number density of compact massive galaxies by artificially changing the limiting stellar mass within the stellar mass median error ($\mathrm{d} \ensuremath{\log_{10}}(M_\star /M_{\sun}) = 0.09$). The value of the resulting error on the number density depends on the chosen compactness definition and on the redshift bin, but it is on the order of $\sim 10$\%. This error is included in Figures~\ref{fig:density} and~\ref{fig:densitysimulations}. For illustration purposes, we also compute the compact quiescent GSMF for the samples following the \citet{VanderWel2014} compactness definition. Less (black crosses) and most (red crosses) compact candidates are shown in Figure~\ref{fig:massfunction}. They follow the global behaviour of quiescent galaxies. In the lower redshift bin ($0.2 < z < 0.3$) the knee of the GSMF is only visible for the less compact sample. \subsection{Results \label{sec:results}} \begin{figure*} \includegraphics[width=\textwidth]{fig15.eps} \caption{Evolution of the number density of quiescent compact massive galaxies down to redshift 3. Different colours indicate different definitions of compactness: red and black for the most and less conservative criteria of \citet{VanderWel2014}, respectively (see section~\ref{sec:compact}), blue refers to the one adopted by \citet{VanDokkum2015}, pink and green to the most and less conservative criteria of \citet{Carollo2013}, respectively. Densities obtained with CS82 data are shown with large squares (this work), diamonds represent \citet{VanderWel2014} data, circles \citet{VanDokkum2015} and stars \citet{Carollo2013} ones. At intermediate redshifts we also plot as triangles the results of \citet{Damjanov2015} based on the COSMOS data, following the same colour code.} \label{fig:density} \end{figure*} In Figure~\ref{fig:density} we compare our results for the variation of the number density of massive quiescent compact galaxies in the Stripe~82 over the redshift range $0.2 < z < 0.6$ to their counterparts at higher redshifts in the literature, using the same definitions of compactness \citep{Carollo2013, VanderWel2014, VanDokkum2015}. We observe that the density of massive compact quiescent galaxies at intermediate redshifts decreases towards lower redshifts for two of the compactness criteria \citep{VanderWel2014, VanDokkum2015}, while it remains approximately constant following the criteria of \citet{Carollo2013}. We find that the number density of the most compact samples of \citet{VanderWel2014} and \citet{Carollo2013} are 1.3 dex and 0.8 smaller than the number density of their corresponding less compact selections, respectively. Both the minimal mass of the sample and the compactness definition have an influence on the behaviour of the derived number density of compact massive galaxies. Within the error bars, we confirm the trend observed by \citet{Carollo2013} from redshifts $z = 1.0$: the number density of compact galaxies with a mass larger than $10^{10}\,M_{\sun}$ is roughly stable since redshift $z\sim 0.8$. Our data does not connect easily to other higher redshift data: \citet{VanderWel2014} and \citet{VanDokkum2015} observe the beginning of a decrease at redshift $z\sim 1.5$ that leads to values at intermediate redshifts that are lower by a factor $\sim 5-6$ than our observations. However, \citet{Damjanov2015} observe the same trend as us at intermediate redshifts working on the COSMOS field and applying the compactness criteria of \citet{VanderWel2014}, albeit with larger error bars. The gap is likely due to the limited volume of CANDELS at intermediate redshifts or to a bias in the sample selection and definition. We observe the same trend as \citet{Cassata2013}: the number density of smaller early-type galaxies evolves more rapidly than that of larger ones. We do not compare directly our density with their result as they adopt a minimal stellar mass of $10^{10}\,M_{\sun}$, that we consider to be too low in the context of our paper. Current N-body simulations have provided some clues to understand the evolution of the population of compact massive quiescent galaxies with cosmic times. \citet{Furlong2015} have applied the less conservative criterion of compactness of \citet{VanderWel2014} on the EAGLE simulation. The gravitational force softening length (i.e. the spatial resolution) of the largest EAGLE simulation used in their analysis is $\epsilon = 0.70$~kpc. They test the convergence of their results by comparing runs of various resolutions. Below the resolution of the simulations, subgrid models are applied. The gravitational softening is smaller than the strongest criteria of \citet{VanderWel2014}, making them adequate for comparison. They find that the number density of compact massive quiescent galaxies increases for decreasing redshifts until $z\sim 0.7$, then declines for $z<0.8$. At high redshifts, the discrepancy between their data and the observed density by \citet{VanderWel2014} is likely due to the limited box size of the simulation. However, we emphasize that the comparison with observations is not that simple, because the determination of the effective radius and the stellar mass are done in different ways. We show the comparison of our measurements at intermediate redshifts with the EAGLE measurements in Figure~\ref{fig:densitysimulations}. At intermediate redshifts, they expect a continuous decrease of the number density of massive compact galaxies that we do observe in our study but with an offset of $\sim 0.7$\,dex. \citet{Quilis2013} used semianalytical models based on the Millenium simulation to calculate the expected fraction of massive compact galaxies that remain almost untouched since redshifts $z>2$, i.e. that evolve in stellar mass by less than 30\%. Applying similar cuts in mass and circularized effective radii (see sections~\ref{sec:samplesel} and~\ref{sec:compact}), we obtain number densities that are within the error bars of the expected value of \citet{Quilis2013} and that follow the same trend. Finally \citet{Wellons2016} also predict that the number density of compact massive quiescent galaxies should decrease in the local universe; although they attribute this to the processes that galaxies undergo during their evolution, they provide no further quantification of these conclusions. We investigate the parameters of the compact massive galaxy definition that lead to different behaviours of the number density at intermediate redshifts. We identify that the increase of the number density is strongly related to the lower limit in mass of the sample of massive galaxies. Applying the minimal masses of \citet{VanderWel2014} and \citet{Quilis2013} as defined in section~\ref{sec:samplesel} associated to the compact criterion of \citet{Carollo2013}, we do observe an increase of the number density of compact massive quiescent galaxies at intermediate redshifts. This is confirmed by \citet{Carollo2013} concerning their most massive sample of compact quiescent galaxies. \begin{figure} \includegraphics[width=84mm]{fig16.eps} \caption{Evolution over cosmic times of the number density of compact massive quiescent galaxies. Our results are compared with simulations. Large squares present this work, following two different compactness definitions: in black the loosest definition of \citet{VanderWel2014} and in green the one of \citet{Quilis2013}. The green area shows the expectations of \citet{Quilis2013} from semianalytical models. Black hexagons show the prediction of \citet{Furlong2015} in the context of the EAGLE hydrodynamical simulation. Black diamonds show the less compact criterion of \citet{VanderWel2014}.} \label{fig:densitysimulations} \end{figure} \section{Discussion and concluding remarks} \label{sec:conclusion} Hydrodynamical simulations suggest that the compact passive massive galaxy population is continuously evolving. According to \citet{Furlong2015} and \citet{Wellons2016} the main size growth mechanisms of passive galaxies between $z>1.5$ and $z=0$ are acquisition of ex-situ stars through dry-merger events and renewed star formation events also triggered by mergers. Thus very few will have been left untouched with cosmic time, making untouched relics very rare. Studying the number density evolution of compact massive relics is unlikely to reflect the evolution of individual galaxies, but instead gives indications about the frequency of the merging processes that this population encounters over cosmic times. Comparing our results with simulations, we thus confirm the stochastic behaviour of the minor merging processes. We observe a constant decrease of the number density of this galaxy population at intermediate redshifts, and notice that the normalization and the behaviour of the number density is clearly sensitive to the definitions adopted to characterize compact relics. Our results are in agreement with the conclusions of \citet{Carollo2013}: we indeed find that newly quenched galaxies may have typical sizes larger than high redshift ones to explain the progressive disappearance of compact massive galaxies. We however observe an individual evolution of this relic population, that is confirmed by adopting minimal masses larger than $M_\star > 5\times 10^{10}\,M_{\sun}$ instead of $M_\star > 3\times 10^{10}\,M_{\sun}$ as in \citet{Carollo2013}. The number density of compact quiescent galaxies is particularly sensitive to the mass interval considered. The population of compact galaxies at intermediate redshifts is scarce and therefore requires a large survey area to have enough statistics. Stripe 82 data complies with many crucial points in this context and allow us to reduce significantly the error bars on the compact relic number density. We note an offset between our observations and the \citet{Furlong2015} predictions (see Figure~\ref{fig:densitysimulations}) and attribute it to potential environmental effects, considering that the volume probed by hydrodynamical simulations is smaller than ours. This effect known as cosmic variance has an influence on galaxy population properties. \citet{Moster2011} show that for the COSMOS, EGS and GOODS fields, we should expect a cosmic variance of $\sim 0.2$, $\sim 0.25$ and $\sim 0.35$ for massive galaxies at intermediate redshifts, respectively. Moreover, as underlined by \citet{Stringer2015}, \citet{Wellons2016} and \citet{PeraltaDeArriba2016}, the environment of compact galaxies plays a critical role with respect to their potential survival. We note that although these studies all agree on this matter, they have conflicting conclusions on the specifics: the first study alleges that isolated galaxies are more likely to be protected from merger events, whereas the other two studies point to the dense central regions of galaxy clusters as the most likely places to find relics. In a future paper we envisage exploring the impact of environment on the compact galaxy population in the context of the Stripe 82 survey, with a sky coverage that does not suffer from pre-selection based on the environment. Despite the fact that we have based our analysis on ground based images of excellent quality, we cannot exclude that there is possible contamination in our sample coming from stars and from inaccurate morphological parameters. Size estimates might be a source of systematics, in particular for galaxies that have close neighbours; these represent $\sim 11$\% of the total sample. The fit of the surface brightness profile by a de Vaucouleurs profile with the \textsc{PSFEx}\xspace and \textsc{SExtractor}\xspace packages results in size overestimates for galaxies that are not adequately described by a pure bulge. This translates into an underestimate of the number densities of compact galaxies (see section~\ref{sec:sizecheck}). The population of compact quiescent galaxies that we have identified is therefore conservative and our conclusions will not be affected but strengthened by this systematic effect. \bigskip In this paper, we have identified a population of quiescent massive compact galaxies at intermediate redshifts, making use of the exceptional multiwavelength coverage of the equatorial region called Stripe~82. Morphological parameters were derived running \textsc{SExtractor}\xspace and \textsc{PSFEx}\xspace codes on CFHT/Megacam deep $i$-band images from CS82. We apply different definitions of compactness to compare our results to previous studies. We find that: \begin{enumerate} \item There is a strong dependence of the absolute number density of compact massive galaxies with the adopted compactness definition. It varies e.g. by a factor of $\sim 80$ between the \citet{Carollo2013} and the strictest \citet{VanderWel2014} definitions. This variation is significantly larger than the errors on the number density. \item The number density of compact massive galaxies evolves relatively slowly at intermediate redshifts. It decreases with cosmic time by a factor of $\sim 5$ between $z=0.6$ and $z=0.2$ when adopting the \citet{VanderWel2014} or \citet{VanDokkum2015} definitions and remains constant within error bars according to the compactness definition of \citet{Carollo2013}. We note that the evolution of the number density with redshifts is significantly smaller than the absolute variation due to the adopted compactness definition. \item A significant offset in number density is observed between our measurements at intermediate redshifts and previous works. We systematically find larger number densities by a factor of $\sim 5$ compared to \citealt{VanderWel2014} and \citealt{VanDokkum2015} at $z\sim 0.6$. Cosmic variance might explain this difference as our volume at that redshift is $\sim 330$ times larger than the CANDELS one. Our measurements at $z=0.6$ are roughly compatible with the number densities obtained at redshifts 1.5-2 by \citealt{VanderWel2014} and by \citealt{VanDokkum2015}. This lack of evolution suggests that most of the size evolution observed in these populations is due to progenitor bias. Only the abundance of extreme compact galaxies (the most compact galaxies of \citealt{VanderWel2014}) seem to have dropped by a factor of 20 since $z=2$. This is likely due to the disappearance of very compact progenitors below $z<2$ and to the global size growth of early type galaxies over cosmic times. This confirms the stochastic behaviour of merging processes observed by hydrodynamical and cosmological simulations. \end{enumerate} \section*{Acknowledgements} We thank our anonymous referee for useful comments that improved this paper. AC is supported by the Brazilian Science Without Borders program, managed by the Coordena\c{c}\~ao de Aperfei\c{c}oamento de Pessoal de N\'ivel Superior (CAPES) fundation, and the Conselho Nacional de Desenvolvimento Cient\'ifico e Tecnol\'ogico (CNPq) agency. Fora Temer (FT). KMD and TSG thank the support of the Productivity in Research Grant of the Brazilian National Council for Scientific and Technological Development (CNPq). MM is partially supported by CNPq (grant 312353/2015-4) and FAPERJ (grant E-26/110.516/2-2012), FT. TE is supported by the Deutsche Forschungsgemeinschaft in the framework of the TR33 `The Dark Universe'. HHi acknowledges support from the DFG under Emmy Noether grant Hi 1495/2-1. HYS acknowledges the support from Marie-Curie International Incoming Fellowship (FP7-PEOPLE-2012-IIF/327561) and NSFC of China under grants 11103011. CBG acknowledges financial support from PRIN-INAF 2014 1.05.01.94.02. We thank I. Trujillo, E. Bertin and the LASEX\footnote{\url{http://dgp.cnpq.br/dgp/espelhogrupo/5167044310442074}, Laborat\'orio de Astrof\'isica Extragal\'actica do Observat\'orio do Valongo} members for fruitful discussions. This work is based on observations obtained with MegaPrime/MegaCam, a joint project of CFHT and CEA/DAPNIA, at the Canada-France-Hawaii Telescope (CFHT), which is operated by the National Research Council (NRC) of Canada, the Institut National des Sciences de l'Univers of the Centre National de la Recherche Scientifique (CNRS) of France, and the University of Hawaii. The Brazilian partnership on CFHT is managed by the Laborat\'orio Nacional de Astrof\'isica (LNA). We thank the support of the Laborat\'orio Interinstitucional de e-Astronomia (LIneA). We thank the CFHTLenS team. \bibliographystyle{mnras}
{ "redpajama_set_name": "RedPajamaArXiv" }
335
\section{Introduction} In this paper we will explore different available methodologies to automatically design controllers for tasks that spans many level of abstraction, where the gap between primitive behaviours and the task definition is high. A good understanding of your evolutionary setup is needed to choose the correct strategy with which to tackle complex tasks thus we'll first review the most used types of each element composing an evolutionary setup (controllers, objective functions, ect.) then we'll move the focus on the bootstrapping problem and on the different strategies used to overcome it. \section{Automatic design solutions} \image{ev-setup}{Interactions between elements of an evolutionary setup: arches rappresent input/output. In red: the objective function as an input for the evaluation stage, together with the phenotype (controller)}{0.4} When it comes to automatic design, there are many elements to take into consideration: a configurable or evolvable \textit{controller} is needed, on which an \textit{algorithm} that find the best configuration for that controller is applied. The algorithm must be able to evaluate how good each configuration perform on the required task, for this purpose an \textit{objective function} is used. Sometimes a more convenient and/or compact rappresentation of the controller's evolvable parameters can be used in the evolutive process (\textit{genotype}). A \textit{mapping} can then be defined to obtain the controller corrisponding to that rappresentation (\textit{phenotype}). \\ With all this elements in place we'll have defined an evolutionary setup \refig{ev-setup}. For each one of these (controller, algorithm, fitness function\footnote{``finess function'' usually refers to a type of objective function used in GAs but since here this differentiation is not needed, this term will always refer to an objective function.}, genotype-phenotype mapping) there are however many possible implementations that will be explored in the sections below. \subsection{Evolvable Controllers} There are many controllers that can be evolved with an algorithm, some of them are usable only in the ER field, others can be also designed manually. Among the most used, we can find: \begin{itemize} \item \textbf{Artificial Neural Networks (ANN)}\\ These are the most used evolvable controllers due to their fast convergence and the complexity of the tasks that can be learned. Algorithms have been developed that can train this kind of network in a very short time (\citet{art003}) that aren't task-specific and can be used on many tasks (\citet{art010}). The variable parameters in the evolution process are the weights of the arches, the threasholds of neurons and in some cases even the network topology. The downside of choosing ANNs is mainly the fact that once you obtain a solution, you dont know how it works internally thus making impossible to test properties or doing any kind of analisys (except on very small networks) and can only be used as black-boxes. \item \textbf{Programs (executable code)}\\ Programs composed by executable instructions can also be used as evolvable controllers: once an instruction set has been defined, many algoritms can be used to search on the space of all the possible programs of a given lenght. As an example in \citet{art020} work a program evolved with a genetic algorithm is used to generate a walking loop on different robot morphologies. \item \textbf{Finite State Machines (FSM)}\\ Attempts on the evolution of FSMs have been done in \citet{art001} with the main benefit of the solution being human-readable. Using an FSM means that you can easily combine primitive parametric behaviours by considering them as states in the automations. \item \textbf{Random Boolean Networks (RBN)} This kind of network have been used only recently as controllers in ER. Evolving this networks can produce complex behaviours comparable to the ones obtained with ANN but with a limited state space size, that leave open the possibilities for analysing their internal behaviours. Some studies have been done(see \citet{art012} and \citet{art013}) that suggest that RBNs behaviour can ba analized by mapping them to probabilistic FSM. The disadvantage of using RBNs lies in the limitations for I/O: input from the sensors needs an encoding step before being injected as boolean values in the network, and the same is true for outputs that are expressed as booleans and requires a mapping to the actuators; this can be a problem if the task require complex I/O values. \end{itemize} \subsection{Fitness functions} A core element of the evolutionary cycle illustrated in figure \ref{fig:ev-setup} is the fitness function which once evaluated, discriminates the \textit{``good''} controllers from the low performing ones. The training of a robot for a given task entirely depends on the formulation of the right fitness function that can select the most successful controllers without including task-specific aspects that may introduce a bias in the process. A suggested classification for fitness functions in ER is based on the degree of \textit{``a priori knowledge''} (see \citet{art007}) and from the most to the least task-dependent, can be summarized as follows: \begin{itemize} \item \textbf{Training data fitness functions}\\ These are the kind of fitness functions that measure errors on datasets containing example of task instances coupled with the expected output. Using these functions mean that the task is almost completely defined and the robot is not going to discover anything new, so they're better suited for classification tasks or where the robot have to mimic the behaviour of a human. \item \textbf{Behavioral fitness functions}\\ Task-specific functions that measures how good the robot is doing by evaluating key sensing/acting reflexes useful for the task (e.g. in obstacle avoidance, a term that give an higher score to robots that turns when front proximity sensors are stimulated). These are often composed of many terms (one for each needed behaviour), combined in a weighted sum. \item \textbf{Functional incremental fitness functions}\\ Used in incremental evolution where simpler or primitive behaviors are learned first, and the evolutive path is assisted by the fitness function that change through the evolution until reaching the one that evaluates the complete task. These usually requires an \textit{a priori knowledge} similar or lower than behavioral ones, but the course of evolution is restricted resulting in more trivial solutions and less novelty. \item \textbf{Tailored fitness functions}\\ The function measure the degree of completion of the task, thus requiring less knowledge about possible solutions, letting the robots free to explore all the possibilities (e.g. for a phototaxis behaviour, the distance separating the robot from the light should be minimized like in \citet{art009}). \item \textbf{Environmental incremental fitness functions}\\ Similar to the functional incremental type but instead of adjusting the difficulty of the task, the robot is gradually moved to more complex environments. \item \textbf{Competitive and co-competitive selection}\\ This kind of selection force robots to compete for the same task (competitive) or for an opposite task (co-competitive, e.g. predator and prey) in the same environment so that even with a static simple fitness function, they are required to evolve more complex skill to beat the opponents. \item \textbf{Aggregate fitness functions}\\ These are high-level function that only measure success or failure of the required task so that almost no bias or restrictions are introduced in the evolution. Aggregate fitness functions require the minimum level of \textit{a priori knowledge} but they're also heavily affected by the boostrapping problem, which will be explained in detail in section \ref{sec:bootstrap}. \end{itemize} \subsection{Searching algorithms} Once an initial solution has been evaluated, we need to search for new ones in the space of all the possible controllers, that get better fitness function scores. Usually getting the optimal configuration is out of the question in this field\footnote{Actually, an optmal solution cannot even be defined in this context because the objective function will never define the task entirely: better fitness does't imply better task execution.} due to the large size and low autocorrelation of the search field, hence many euristic search methods are used. \\ The main block on which many searching algorithms are built is the \textbf{Stochastic Descent} (SD) algorithm that works as follows: first a neighborhood function is defined on the search space, that assign to each solution a set of close alternative configurations. Starting from an initial solution a random neighbor is evaluated, and if it gets a better score than the original configuration, we move to this one and pick another random neighbor to test an so on. From a search field perspective, what this algorithm do is moving towards a local optima and stopping there. \\ Many \textbf{trajectory-based} metaeuristics are created from SD that mainly aim to prevent the algorithm from stopping in a local minimum in various ways: accepting worsening steps (\textit{Random Iterative Improvement, Simulated Annealing}), modifying the neighborhood structure (\textit{Variable Neighborhood Search}) or scores (\textit{Dynamic Local Search}), tracking the already explored solutions (\textit{Tabu Search}) or applying a perturbation to the solution and then start SD again (\textit{Iterated Local Search}). \\ Another way to approach the search is by considering many candidate solutions at once and evolve them together exploiting their interactions; these are called \textbf{population-based} metaeuristics. An example is PSO (\textit{Particle swarm optimization}) where while new local optima are found, particles (that rappresent the current candidate solution swarm) are moved towards them hoping to find a good region of the search landscape. The \textit{Ant Colony Optimization} algorithm makes another good example by using an indirect interaction achieved depositing pheromone in the environment toward which other solutions (\textit{ants}) are attracted. \\ The most used branch of population-based metaeuristics are \textbf{evolutionary algorithms}, inspired by the Darwinian evolution theory. These are based on three main operators applied to the population: a \textit{selection} process decide which solutions (genotypes) will be used to breed the next generation, then a combination of \textit{crossover} (which recombine two or more different genotypes into new ones) and \textit{mutation} (which is a random alteration of a genotype) operators is used to obtain the new genotypes. \subsection{Genotype-phenotype mapping} Many types of evolvable controllers can be expressed in a compact form that only includes their variable parameter values, creating a sort of DNA of a given configuration called \textit{genotype}. In this form, the space of the possible solutions can be better explored and complex operator can be easely applied to a given configuration in a meaningful way (e.g. crossover operator in evolutionary algorithms). The possible encodings for a genotype, as suggested in \citet{art014} are: \begin{itemize} \item Binary encoding \item Real-Number encoding \item Integer or literal permutation encoding \item General data structure encoding \end{itemize} A good encoding should also follows four properties that can be summarized as follows: \begin{itemize} \item \textbf{Legality} Any encoding (genotype) permutation corresponds to a solution (phenotype). \item \textbf{Completeness} Any solution has a corresponding encoding. \item \textbf{Lamarckian Property} the meaning of a subset of the encoding (gene) should be contex-independent. \item \textbf{Causality} Small variations on the genotype space due to mutation imply small variations in the phenotype space. \end{itemize} \section{Complex Tasks: problem and solutions} \label{sec:bootstrap} Complex tasks are one of the main challenges for automatic design of controllers and robot learning. A learning robot accumulate competence on the task from experience (trial and error approach) but when a fitness function points to an objective that is too far beyond its primitive capacities, the evolution will fail to differentiate between initial configurations (that will all be evaluated with the lower score, see \citet{art011}). This problem is know as \textit{bootstrap problem} and its the main cause of failures on complex tasks as explained in \citet{art015}. From a fitness landscape POV this problem is caused by fitness plateus: flat regions that, depending on the search algorithm, can make the evolution very slow or even impossible (\citet{art016}). In the following sections the most used strategies to overcome this problem and to drive the evolution on the right path will be explored. \subsection{Hierarchial strategy} This approach is based on a \textit{divide and conquer} way of thiking: to fill the gap between the robot capabilities and the task requirements one can simply teach the robot the needed primitives first, and then evolve it on the complete task exploiting those primitives. \subsubsection{Primitives - Arbitrators} If the complete task is an immediate combination of a finite number of primitive behaviours, the primitive-arbitrator architecture is the ideal one. Since many of the tasks that appears complex are actually only composite tasks, this approach firstly described in \citet{art006} works very well and its largely adopted in many works.\\ \image{duarte-arch}{The controller architecture used in \citet{art002} experiment, composed of 3 behavior arbitrators and 4 behavior primitives.}{0.2} In \citet{art002} work, the task consisted in a robot that have to: \textit{I.} exit and obstacle filled room to reach a double-T maze, \textit{II.} solve the maze to find another robot using a given light-code indication (so that memory is involved since the robot must remember the code to find the correct path), \textit{III.} resque the other robot by bringing it back to the first room. The choosen architecture that achieved a very high solve-rate (92\%, 22 robots out of 24) can be seen in figure \ref{fig:duarte-arch}, where each block represents a separately evolved ANN. In order to achieve succesful results they manually decomposed the task and used a behavioural fitness function for evolving the main arbitrator. \\ A similar approach is used in \citet{art004} where arbitrators are explicitly thought as \textit{switchers} that activate one of the sub-modules based on the current sensor inputs. The architecture is proven to be robust to sensor noise by testing it on a real robot assembled with LEGO Mindstorms. \subsubsection{GP and regulatory genes} The weakness of an hierarchial strategy lies in the manual task decomposition step, that requires human intervention in the evolutive process. In \citet{art017} a proposed solution is to use GP (particularly \textit{Gene Expression Programming}) with the incorporation of a \textit{regulatory gene} as a part of the chromosome. This gene will regulate the activation of the others, thus composing a layered architecture that can be automatically evolved. This architecture is used in the paper to train robots on wall following and foraging tasks where specialized genes that are activated to perform sub-behaviours can be observed. However the tasks used here were quite simple and the proposed approach is not outperforming similar techniques that don't use regulatory genes. \subsection{Incremental strategy} Instead of decomposing the whole task into smaller primitives, here the idea is to learn a simpler and/or partial version of the task, gradually achieving the original goal by acting on the fitness function. \subsubsection{Training on a simplified task first} This strategy also know as \textit{scaffolding} or \textit{robot shaping} has been succesfully applied to solve complex tasks. As a first example we can look at \citet{art025} work were a prey-predator task is involved. The predator neural network is firstly evolved against a full capable prey (capable of making many (time-discrete) moves with fast speed) showing that the evolution stall at a low fitness value due to the complexity of the task. Then a set of eight increasingly difficult tasks is set up, where in the first task the prey is completely still (easy to capture) and the last task is the same as the original one. Starting the evolution from the first task, and then gradually moving to the more difficult ones once the robot solves them showed to be effective: every time the task is switched there is a drop in the fitness value and the robot start learning the new task, re-gaining an high fitness even on the last (original) one. \\ Another more complex experiment is the \citet{art018} one where the scaffolding technique is applied twice for the same task along two dimensions. Here the task is a phototaxis behavior for legged robots that with the direct approach gives good results only after 30 CPU hours. To speed up the task, scaffolding is applied on both an environmental (as different orientations of the light) and morphological (from legless to legged) level in various sequences, even interleaved. The configuration where morphological scaffolding was applied first, showed the best results reaching a good fitness in less than 10 hours. \subsubsection{Training on a part of the task first} When we approach a composite task, where there are multiple behaviors to be learnt, an incremental strategy is also possible where these are taught one by one until the robot learn the complete task; this strategy is also known as \textit{behaviour chaining}. \\ In \citet{art021} an experiment on learning two conflicting tasks is conducted with the goal of understanding what training sequence gives the best results and why. The two analyzed tasks are performed in a virtual arena and are a gradient following behaviour where the robot have to reach the top of the arena, and a rough terrain avoidance where it must learn to avoid ``dangerous'' zones that are arranged in a maze-like configuration. The tests are based on three setups where in the first the robot is trained in both tasks simultaneously, while in the others one of the tasks is learned first, and only at this point the other one is introduced in the fitness function. The results show that using an incremental strategy can lead to better performances if the hardest task is trained first. \\ In \citet{art022} paper the performance of learning 3 tasks simultaneously is tested against an incremental approach. The tasks are namely basic locomotion (since the robot morphology is unknown and the tests are carried out on twelve different robots), turning toward a moving target point and obstacle avoidance. In the incremental strategy the robot is trained in order in each task separately and as the paper shows, every robot configuration reach a good level of fitness faster than in the simultaneous approach. \subsubsection{Dynamic fitness functions} Incremental strategies seen so far change environment, robot or fitness function for a discrete number of training steps. The fitness function can be however made time-dependent in a way that the difficulty of the task increase dinamically over the generations without any abrupt change. In \citet{art011} this principle is applied to the evolution of a predator robot in a prey-predator task where the difficulty of the task depends on two parameters: the prey speed and initial distance from the predator. These are modulated by a monotonically time-dependent increasing function $G(t)$ so that the task become more and more difficult until reaching the desired final task. In the paper $G(t)$ is hand-tuned and the results show the increase in stability and the fast convergence against the standard approach. \subsubsection{Coevolutionary approach} In the previous example with dynamic fitness functions, the function itself was hand-tuned, thus requiring a human intervention to obtain the best performance. But as shown in \citet{art011} the difficulty level can be also automatically tuned by the algorithm itself exploiting coevolution. This can be achieved by making the reward for solving a task inversely proportional to the number of solutions already found by other robots, forcing the evolution to focus on tasks that are on the edge of what the current population can do. This methodology required more generations of the hand-tuned one to achieve the same fitness but still performed much better than the standard approach. \subsection{Structural controller evolution} \label{sec:netevolution} The complexity of searching a good controller configuration for the task can also be reduced by using a smaller controller thus reducing the search space. But often if the task is a composed/complex one, a small controller is not enought to produce good results. An idea to combine the benefit of both sizes is to start with population of small controllers that due to the reduced number of possible configurations are more likely to give a good start to the evolution that have a lower chance of getting stucked in fitness plateus. Then to get more complex dynamics able to achieve a good performance on the task, another operator is added to the evolutionary process that expand the controller size with a given probability (e.g. adding a state to an FSM or a line of code to an evolved program). \\ This metodology is mostly applied with ANNs, where a node is added to the network. An example can be found in the NERO game (\citet{art003}) where the rtNEAT algorithm is used: the algorithm is fast enoght to evolve controllers for a swarm of fighters (simulated agents with moving/shooting capabilities) in less than a minute of computation. \subsubsection{Macro elements and mixed evolution} Operators can also be added to expand the controller with different elements, that are not necessarily omogeneous with the rest of the architecture: these could be used to introduce primitive parametric blocks that already expose a specific non-trivial behaviour. As an example we can look at \citet{art010} paper where the NEAT algorithm is expanded to choose between various operator that can also add radial basis functions (RBF) instead of neurons. This strategy helped the NEAT algorithm doing well in many diferent tasks making it more generic. \subsection{Modular architectures} Complexity can be also found in the robot itself when its attuators need to be controlled together in a specific way to achieve a primitive behaviour. Think about a task as simple as going straght from point $A$ to point $B$: if the robot is an \textit{e-puck} you just need to activate its two wheels at the same speed to make it go straight. In \citet{art008} a similar task is studied for a miniature helicopter where the sensor inputs are position, velocity, rotation and rotational speed along the three axis for a total of twelve values and the four attuators control the rotor speeds and blade inclinations as in a real helicopter. To stabilize the helicopter and make it able to move forward these attuator needs to be operated in a given, coordinated way, while the other configurations would make it unstable and unable to move along the path giving the worst fitness score: this is exactly what generate the boostrap problem. One of the working approach found in the paper was to split the ANN controlling the robot in four simpler modular networks, each controlling one attuator and using only the needed subset of inputs. Even if these were still evolved together with the same fitness function, this setup was able to yeld much better results. \subsection{Evolutionary Bias} As an addition to all the strategies above, evolutionary biases should be mentioned. This is the simplest way to push learning forward in an early stage simply by introducing a tailored term in the objective function that, even if its not directly related to the task itself, can be used drive the evolution on a given path.\\ To show the benefits of a simple bias we should look at \citet{art019} paper where robots using ANNs have to be trained in playing a \textit{capture the flag} game. The complexity of this task lies in sensorial input and network size: a matrix of 150 colors from an image sensor is used, processed with a neural network with up to 5000 connections. An aggregate fitness function evaluates the number of victories, while to overcome the initial bootstrap problem another tailored term is introduced, that measure the distance traveled in the arena by the robot.\\ It's important to remember that biases despite being useful in an initial stage, greatly limit the search space and should thus be used with caution. In the above example the score given by the traveled distance term was at most half of the one given for a victory, so that once a winning behaviour is reached, the bias will be ignored. \section{Conclusions} The automatic design of robot controllers is not a fresh topic and many researchers have been exploring this field developing many different evolutionary setups. However to increase the value of these methodologies much work have still to be done in making them capable of tackling increasingly complex tasks while improving their generality.\\ In this paper the most widely used evolutionary setups are explained together with one of the problem that limit their usability on complex tasks: the bootstrap problem. The most used strategies to overcome this problem has been classified showing some of the work done for each one. Despite achieving good results, these techniques either still lack in generality because of their application on a limited number of tasks, or require too many hand-tuned steps (like the task decomposition step in most of the hierarchial approaches), keeping all options open for new works on other strategies or improvements of the existing ones. \bibliographystyle{plainnat}
{ "redpajama_set_name": "RedPajamaArXiv" }
3,879
package io.atomix.utils.time; /** * Clock. */ public interface Clock<T extends Timestamp> { /** * Returns the current time of the clock. * * @return the current time */ T getTime(); }
{ "redpajama_set_name": "RedPajamaGithub" }
381
I have just finished grading all the exams (3.30pm). The following are the final scores. I will leave the exams with the office tomorrow. You can check your scores/exams and email me if there are any problems. I will only send the final scores in about a week when you have had time to check your scores and email me about any problems. PLEASE TAKE YOUR RUBBISH FROM THE CLASS IF WE ARE IN THATCHAI. THE LADY THERE ALWAYS LOOKS AT ME LIKE I AM TO BLAME AFTER CLASS. THANK YOU. Everyone in your group should participate. Some should introduce the presentation, and at least 4 should actually demonstrate interpretive reading. Remember you only have 10 minutes. Don't waste any time. Please email me at garethfinch@hotmail.com if you have any questions (not Facebook). Please check all of the pages of the course website before emailing me.
{ "redpajama_set_name": "RedPajamaC4" }
5,384
package com.sgrailways.giftidea; import android.text.Editable; import android.text.TextWatcher; public abstract class AfterTextChangedListener implements TextWatcher { @Override public void beforeTextChanged(CharSequence s, int start, int count, int after) { } @Override public void onTextChanged(CharSequence s, int start, int before, int count) { } public abstract void afterTextChanged(Editable s); }
{ "redpajama_set_name": "RedPajamaGithub" }
577
It is never too soon to start putting away money for your retirement. Today, there are several options available, including IRAs and 401(k) plans, both of which are popular and help grow money for retirement tax-deferred. While most of us are aware of retirement plans, and in many cases have started saving money, there are several common mistakes that slow down the retirement planning and savings process. Here are the top 5. 1. Not taking advantage of time. The earlier you start, the more your money will have time to grow in your retirement accounts. Too many people make the mistake of putting off starting a retirement savings plan. 2. Not investing regularly. Many people start investing and then stop. If you do not invest on a regular basis, you cannot expect your retirement savings to grow. 3. Not taking full advantage of tax-free retirement accounts. The more you put into tax-free retirement accounts, the more money you can grow tax-free. If you can afford to put in the maximum contribution to your retirement accounts each year, you should do so. 4. Poor asset allocation. If you are investing too conservatively, you may not be able to build the amount you are hoping to have for your retirement years. Conversely, if you are getting close to retirement and are investing in high-risk investment vehicles, you may lose much of what you have worked so hard to save. How you allocate your assets is more important than what you select within a given asset class. 5. Not creating a post-retirement plan. As you approach retirement you should determine how much money you will need and establish a plan for handling your money during your retirement years. This would include knowing all of your income sources, including investments, Social Security, and pensions. "A retirement account contribution of $5,000 today at age 23 will be worth nearly $3,00,000 when you retire at age 70, assuming a 9 per cent return," notes Bob Morrison, a financial planner in Denver. The early start also is a very effective strategy if you're worried about how much you can set aside. Vanguard Investments tested scenarios and investment strategies for investors aged 25,35 and 45, aiming for a retirement age of 65. The investor who starts at age 25 with a moderate investment allocation and contributes 6 per cent of salary will finish with 34 per cent more in her account than the same investor who starts at 35 — and 64 per cent more than an investor who starts at 45. Put another way, the 35-year-old would need to boost her contribution rate to 9 per cent to achieve the same result as the 25-year-old starter who was saving 6 per cent. Research by Aon Hewitt found that 43 per cent of workers in their 20s contribute to 401(k)s at rates too low to capture the full match, compared with 29 per cent of all workplace savers.
{ "redpajama_set_name": "RedPajamaC4" }
1,575
\section{Introduction} The understanding of the formation mechanism of heavy and super-heavy systems in fusion reactions, translated to a problem of diffusion of a many-body quantum system on a multi-dimensional collective potential energy surface (PES), is still a challenge for present-day theory. There is no common viewpoint (see Ref. \cite{Alexis0} for details) regarding the modelling of the intermediate stage of evolution of the compact nuclear shapes towards the compound nucleus (CN) formation in competition with quasi-fission. Quasi-fission means re-separation of the dinuclear molecular complex before the CN formation. The main motivations for the present work have been (i) to reconcile the current conflicting models for CN formation, and (ii) to incorporate the \textit{multi-particle quantum nature} of the fusing system, rather than assuming a continuous macroscopic fluid. This may explain and predict the dependence of fusion (after contact of the nuclei) on the nuclear structure of the interacting nuclei. \section{Theory and numerical results} \subsubsection{Dynamical collective potential energy surface} The main feature of the present theory is the concept of dynamical collective PES. This PES is obtained with Strutinsky's method after (i) solving the two-center problem for fusion microscopically \cite{Alexis1}, and (ii) using the idea of the dissipative diabatic dynamics suggested by N\"orenberg in Ref. \cite{Noerenberg} (see Fig. 1). \begin{figure} \includegraphics[height=.2\textheight]{DiazTorres_VeniceFig2.eps} \caption{Schematic illustration of the diabatic single-particle motion (solid curves) at an avoided crossing of two adiabatic single-particle levels (dashed curves) with the same quantum numbers. See text for further details.} \end{figure} In Fig. 1 a typical avoided crossing of two molecular adiabatic single-particle (sp) levels with the same quantum numbers (dashed curve) is shown schematically. Many of these pseudo-crossings can occur around the Fermi surface of the fusing system. Adiabatic sp orbitals diagonalize the two-center sp Hamiltonian, whereas the diabatic states (solid curves) minimize the strong dynamical non-adiabatic coupling (induced by the collective kinetic energy operator $\sim \partial /\partial q$) at an avoided crossing between two adiabatic sp levels (see Ref. \cite{Alexis1}). In the entrance phase of the reaction, the nucleons can follow diabatic levels \cite{Noerenberg} instead of remaining in the lowest adiabatic sp orbits. This mechanism destroys the Fermi distribution of the sp occupation numbers (there is no thermal equilibrium in the system and, strictly speaking, the concept of temperature is meaningless). Diabaticity only produces coherent particle-hole (ph) excitations that contribute to the collective PES. The two-body residual interactions gradually destroy these coherent ph excitations, i.e., the system heats up and the sp occupation numbers evolve in time towards a Fermi distribution for a finite temperature. The evolution in time of the nuclear shapes (a non-equilibrated macroscopic process) occurs in conjunction with the intrinsic thermalization of each nuclear shape. The multi-dimensional collective PES, on which the nuclear shapes diffuse, is dynamical. This is initially diabatic (a sort of sudden PES) and gradually becomes adiabatic. \begin{figure} \includegraphics[height=.3\textheight]{DiazTorres_VeniceFig3.eps} \caption{Entrance diabatic PES as a function of the separation between the nuclei R and the mass partition $\eta$ for different entrance channels $\eta_0$ leading to $^{256}$No. See text for further details.} \end{figure} \begin{figure} \includegraphics[height=.3\textheight]{DiazTorres_VeniceFig4.eps} \caption{(Left) Entrance driving potentials (curves other than the two lowest ones) for the reactions presented in Fig. 2. The two lowest curves are the asymptotic adiabatic driving potential (red dotted curve) and the liquid drop energy (LDE) only (black solid curve). (Right) Adiabatic PES as a function of R and $\eta$ for the cold system $^{256}$No. See text for further details.} \end{figure} Fig. 2 shows the entrance diabatic collective PES (liquid drop energy + shell corrections + diabatic contribution) as a function of the separation R between the nuclei and the mass partition (mass asymmetry $\eta$) for different entrance channels $\eta_0$ (target-projectile combinations) leading to the CN $^{256}$No. This PES reveals a strong repulsive core at small radii R and at large mass asymmetry $\eta$. The initial configuration of the sp occupation numbers of the separated interacting nuclei along with the shell structure of the different nuclear shapes determine these PES. Fig. 3 (left) shows a cut of these PES along the mass asymmetry coordinate $\eta$ at the contact radius of the different fragmentations (entrance driving potentials). The two lowest curves correspond to the adiabatic driving potential V$_{adiab}$ (liquid drop energy + shell corrections, red dotted curve) and the liquid drop energy (LDE) only (black solid curve). The entrance driving potential is raised with respect to the adiabatic potential due to diabatic effects. Please note that there are shell effects in the entrance driving potentials that are not related to the static ground-state shell corrections, but to the diabatic sp motion through the shell structure of the different nuclear shapes. These dynamical shell effects are reflected in the mass yield of the quasi-fission fragments discussed below. During the fusion process the entrance diabatic PES (Fig. 2) relaxes to an asymptotic adiabatic PES which is less structured than that shown in the right panel in Fig. 3 (here the shell corrections are calculated at zero temperature) because the shell corrections decrease at a (local) finite temperature of the nuclear shapes. The competition between fusion and quasi-fission is described as a diffusion process of nuclear shapes through this dynamical collective potential energy landscape, caused by quantum and thermal fluctuations. \subsubsection{Evolution of the compact nuclear shapes} This scenario is modelled \cite{Alexis0} solving a set of master equations coupled to the relaxation equation for the sp occupation numbers. The transition probability rate between the nuclear shapes contains quantum and thermal effects on shape fluctuations (see Ref. \cite{Alexis0}). Owing to the statistical nature of this approach, there is no equation of motion for individual collective coordinates \cite{Aritomo,Zagrebaev}. The master equations only describe the evolution in time of an ensemble of nuclear shapes (parametrically defined by a set of collective coordinates) that develop following contact of the interacting nuclei. The basic macroscopic variable is the nuclear shape, which determines the two-center mean-field in which the nucleons are moving. After capture of the nuclei, the motion of the compact fusing system is expected to be slow (overdamped), as the initial diabatic collective PES practically absorbs the total incident energy of the system. The system of equations has been solved \cite{Alexis0} in a 2D-model using a mesh with respect to the separation between the nuclei R and the mass asymmetry coordinate $\eta$. Each node on the mesh corresponds to a nuclear shape. The whole mesh can be divided in three regions: (i) region of compact shapes around the near-spherical shape of the CN (\textit{fusion region}), (ii) region of separated fragments beyond the Coulomb barrier (\textit{quasi-fission region}), and (iii) region of intermediate shapes which could lead to fusion or quasi-fission (\textit{competition region}). The probability for CN formation $P_{CN}$ is defined as the population of the fusion region, and the quasi-fission probability $P_{QF}$ is described as the population of the quasi-fission region. The time scale for fusion--quasi-fission $\tau_{qf}$ is obtained from the condition that following capture the initial (unit) probability of the colliding nuclei occupying the contact configuration (located in the competition region) becomes zero as the probability distribution bifurcates into the fusion and the quasi-fission regions. The mass yield of the quasi-fission fragments is calculated by projecting the quasi-fission probability $P_{QF}$ along the mass asymmetry coordinate $\eta$. It is important to emphasize that our theoretical mass distribution does not include the fission component (decay of the CN into two fragments), but is limited to all binary fragmentations which occur after capture and before the CN formation. This is exactly what we call quasi-fission. \begin{figure} \includegraphics[height=.3\textheight]{DiazTorres_VeniceFig6.eps} \caption{Evolution in time of the probability distribution of the nuclear shapes (dynamical solution of the master equations) for $^{48}$Ca + $^{208}$Pb $\to$ $^{256}$No ($\eta_{0}=0.625$). See text for further details.} \end{figure} Fig. 4 shows the evolution in time of the probability distribution of the nuclear shapes (solution of the master equations) on the dynamical PES for the reaction $^{48}$Ca + $^{208}$Pb $\to$ $^{256}$No. The collision is central and the total incident energy in the center of mass (cm) frame is 30 MeV. Further details can be found in Ref. \cite{Alexis0}. It is important to note that the colour scale covers thirty orders of magnitude. In this picture we can see that initially (time up to $2*10^{-22}$ s) the distribution of probability mainly spreads along the nuclear shapes at the contact separation. During this period of time the mass asymmetry coordinate $\eta$ plays the relevant role. Later on, when the diabatic collective PES has completely relaxed to the adiabatic one (relaxation time is about $5*10^{-22}$ s), the maximal values of the probability move to the fused compact shapes (small R). \subsubsection{Observables} Fig. 5 shows the dependence of $P_{CN}$ and the quasi-fission mass yield ($P_{QF}$ vs. $\eta$) on three crucial physical parameters that may control the dynamical evolution of the compact nuclear shapes, namely the total incident energy $E_{cm}$ (top panels), the total angular momentum $J$ (middle panels) and the entrance channel mass asymmetry $\eta_{0}$ (bottom panels). The quasi-fission time $\tau_{qf}$ remains around $10^{-22}$ s (see Ref. \cite{Alexis0}). At the top, we can see in the calculation for a central symmetric collision, that the maximum of $P_{CN}$ is around the capture barrier energy ($30$ MeV) and slightly decreases with increasing incident energy. At the middle, we see that $P_{CN}$ for a symmetric collision at $E_{cm}=30$ MeV weakly depends on the angular momentum for the smaller partial waves up to $40 \hbar$. As discussed in detail in Ref. \cite{Alexis0}, the dependence of $P_{CN}$ on $E_{cm}$ and $J$ can be explained in terms of the competition between the phase space of the quasi-fission fragments and the fused nuclear shapes. In the mass yields for a symmetric entrance channel (top and middle right panels), we can see structures which are related to the structures (valleys) of the entrance diabatic collective PES (see left panel in Fig. 3), while the main peak corresponds to the entrance channel mass asymmetry $\eta_{0}=0.0$. In contrast to this reaction, the quasi-fission mass yield for $^{48}$Ca + $^{208}$Pb ($\eta_{0}=0.625$ in the bottom right panel) shows a minimum at this entrance mass partition. Here the calculations are for a central collision at $E_{cm}=30$ MeV. This minimum is associated with a local maximum for $P_{CN}$ as presented in the bottom left panel (see small inserted picture). In this panel, the black solid curve includes all shell effects (shell corrections + diabatic effects). In the blue dotted curve, the shell corrections are removed. The red dashed curve in the top left corner of the small figure inserted is without diabatic effects. What this figure tells us is that (i) diabatic effects can tremendously inhibit the fusion of near-symmetric systems, and (ii) remaining ground-state shell corrections to the collective PES can be very important in establishing the $P_{CN}$ value. \begin{figure} \includegraphics[height=.4\textheight]{DiazTorres_VeniceFig7.eps} \caption{Dependence of $P_{CN}$ and the quasi-fission mass yield ($P_{QF}$ vs. $\eta$) on the total incident energy $E_{cm}$ (top panels), the total angular momentum $J$ (middle panels) and the entrance channel mass asymmetry $\eta_{0}$ (bottom panels). See text for further details.} \end{figure} \section{Concluding remarks} The present preliminary calculations show that (i) the dynamical collective PES partially reconciles conflicting aspects of current models for CN formation, because both collective coordinates mass asymmetry $\eta$ and internuclear distance $R$ play a crucial role in fusion ($\eta$ at the beginning of the reaction and $R$ towards the end when the diabatic PES has relaxed to the adiabatic one), (ii) the diabatic effects and the shell corrections are very important in the onset of fusion hindrance for heavy systems because they strongly influence the topology of the collective PES, and (iii) very asymmetric reactions induced by closed shell nuclei seem to be the best suited to form the heaviest CN because the diabatic effects are minimized and the contact configuration is compact and well inside the capture barrier radius. \bibliographystyle{aipproc}
{ "redpajama_set_name": "RedPajamaArXiv" }
7,733
Salesforce dashboards are a useful feature for quickly and easily sharing company information amongst colleagues, including your management team. Dashboards allow users to see summarized information even if they don't have permission to access the underlying detailed data. Zuora CPQ integration to Salesforce provides standard predefined reports based on the billing and subscription information synchronized from Zuora to Salesforce. These reports can be used to build custom dashboards that provide key insight into your subscription business. In Salesforce, click the Dashboards tab. If the Dashboard tab is not available on your tab bar, click + sign and select Dashboards from the list of tabs. On the Components tab, click the dashboard type you want to build and drag it over to dashboard editing area on the right. On the left navigation, click the Data Sources tab. By default, Zuora CPQ provides some data sources that correspond to the standard predefined Zuora Reports included in the Zuora CPQ package. You can also create custom reports from the Zuora data and use those custom reports on a dashboard. Select a data source and drag it over to dashboard editing area on the right. If the data source is not suitable for the dashboard type, you will receive the following error. In the event you receive an error, you need to either select a different dashboard type or a different data source and drag it over dashboard editing area and drop it on top of the error message. Once the data source has been applied to the dashboard, you can add a custom header, title, and footer by entering text in the EditHeader, EditTitle, and Editfooter fields. Add a Title to name your dashboard. The Dashboard Unique Name field will be automatically populated. Click Save and Run Dashboard to save and generate the dashboard. The dashboard is now available to view. Any user who clicks the Dashboard tab will be able to see this dashboard.
{ "redpajama_set_name": "RedPajamaC4" }
7,238
Q: How can I load WPFToolkit assembly in Powershell I have installed WPF Toolkit: Location: C:\Program Files\WPF Toolkit\v3.5.40320.1\WPFToolkit.dll Name: WPFToolkit, Version=3.5.40128.1, Culture=neutral, PublicKeyToken=31bf3856ad364e35 Type: Library I can load it by full path: [System.Reflection.Assembly]::LoadFrom("C:\Program Files\WPF Toolkit\v3.5.40320.1\WPFToolkit.dll") But can't load by assembly name: [System.Reflection.Assembly]::LoadWithPartialName("WPFToolkit, Version=3.5.40128.1, Culture=neutral, PublicKeyToken=31bf3856ad364e35") [System.Reflection.Assembly]::Load("WPFToolkit, Version=3.5.40128.1, Culture=neutral, PublicKeyToken=31bf3856ad364e35") What is a solution? A: Loading by assembly name doesn't work because the WPFToolkit assembly is neither in GAC nor in the PowerShell directory. There are several options: * *load it by path *add it to the GAC *change powershell.exe.config to look in the WPF Toolkit directory *handle the AppDomain.AssemblyResolve event (not particulary easy in PowerShell V1)
{ "redpajama_set_name": "RedPajamaStackExchange" }
7,652
{"url":"http:\/\/mathhelpforum.com\/algebra\/33030-logarithm-inverse.html","text":"1. ## Logarithm as inverse\n\nWrite the inverse of each function.\n\nPlease show work and short explanation so I understand how to get the answers for the rest of my homework\n\n1) $Y=2^{x\/3}$\n\n2) $Y=log_{5} X^2$\n\nAlso If I Need to solve for Y in the following what is the answer for the following (please show work):\n\n$f(x)=log_4(x+4)-3$\n$X= -2$\n\n2. Originally Posted by north1224\nAlso If I Need to solve for Y in the following what is the answer for the following (please show work):\n\n$f(x)=log_4(x+4)-3$\n$X= -2$\n\nwell lets say you have $log_{base} number$. This is equivalent to $log_{x} number \/ log_{x} base$ with x being whatever you want.....10 for calculating purposes\n\nso\n\n$f(x)=log_4(x+4)-3$\n$x =2$\n\n$f(x)=log_4(2+4)-3$\n$f(x)=log_4(6) -3$\n$f(x)=(log_{10}(6) \/ log_{10}(4) ) -3$\n$f(x)=~1.2925 - 3 = -1.7075$","date":"2018-01-24 10:09:33","metadata":"{\"extraction_info\": {\"found_math\": true, \"script_math_tex\": 0, \"script_math_asciimath\": 0, \"math_annotations\": 0, \"math_alttext\": 0, \"mathml\": 0, \"mathjax_tag\": 0, \"mathjax_inline_tex\": 0, \"mathjax_display_tex\": 0, \"mathjax_asciimath\": 0, \"img_math\": 0, \"codecogs_latex\": 14, \"wp_latex\": 0, \"mimetex.cgi\": 0, \"\/images\/math\/codecogs\": 0, \"mathtex.cgi\": 0, \"katex\": 0, \"math-container\": 0, \"wp-katex-eq\": 0, \"align\": 0, \"equation\": 0, \"x-ck12\": 0, \"texerror\": 0, \"math_score\": 0.868892252445221, \"perplexity\": 334.4899379395476}, \"config\": {\"markdown_headings\": true, \"markdown_code\": true, \"boilerplate_config\": {\"ratio_threshold\": 0.18, \"absolute_threshold\": 10, \"end_threshold\": 15, \"enable\": true}, \"remove_buttons\": true, \"remove_image_figures\": true, \"remove_link_clusters\": true, \"table_config\": {\"min_rows\": 2, \"min_cols\": 3, \"format\": \"plain\"}, \"remove_chinese\": true, \"remove_edit_buttons\": true, \"extract_latex\": true}, \"warc_path\": \"s3:\/\/commoncrawl\/crawl-data\/CC-MAIN-2018-05\/segments\/1516084893629.85\/warc\/CC-MAIN-20180124090112-20180124110112-00237.warc.gz\"}"}
null
null
Q: Destructuring of union types in typescript Is there a way (similar to pattern matching from functional languages) to destructure a union type in TypeScript, i.e. some construct like: var a: Foo | Bar = ...; a match { case f: Foo => //it's a Foo! case b: Bar => //it's a Bar! } If there is no such construct - are there any technical difficulties in creating such construct? A: TypeScript understands Type Guards as a way of decomposing union types. There are several ways you can use this. If Foo or Bar is a class, you can use instanceof: if (a instanceof Foo) { a.doFooThing(); } If they're interfaces, you can write a user-defined type guard: function isFoo(f: any): f is Foo { // return true or false, depending.... } if (isFoo(a)) { a.doFooThing(); } else { a.doBarThing(); } You can also use typeof a === 'string' to test for primitive types in a union (string, number, or boolean)
{ "redpajama_set_name": "RedPajamaStackExchange" }
3,522
Patrick Leahy on Foreign Policy Democratic Sr Senator (VT) Signed letter opposing Israeli annexation of territories Alexandria Ocasio-Cortez and Pramilla Jayapal sent a Dear Colleague letter to Secretary of State Pompeo, expressing concern that annexation would "lay the groundwork for Israel becoming an apartheid state" and calling for the non-recognition of annexed land and withholding of some of the $3.8 billion in military funding. Her compelling letter was signed by a dozen other Congresspeople, including influential figures such as Rep. Ayanna Pressley and Sen. Bernie Sanders. The AOC-Jayapal letter on annexation made headlines and sent the Israel lobby into a tizzy, frantically trying to stop any other lawmakers from signing on. But just a few days later, on July 2, another unexpected action came. Sen. Chris Van Hollen, supported by Senators Sanders, Warren, Leahy, and others, filed an amendment to the National Defense Authorization Act to prohibit US military aid from being used in any annexation activities. Source: Counterpunch.org on 2022 Vermont Senate race , Jul 17, 2020 Voted NO on cooperating with India as a nuclear power. Congressional Summary:US-India Nuclear Cooperation Approval and Nonproliferation Enhancement Act: Approves the US-India Agreement for Cooperation on Peaceful Uses of Nuclear Energy. Declares that it is US policy to prevent the transfer to India of nuclear equipment, materials, or technology from other participating governments in the Nuclear Suppliers Group or from any other source; and any nuclear power reactor fuel reserve provided to India for use in safeguarded civilian nuclear facilities should be commensurate with reasonable reactor operating requirements. Proponent's argument to vote Yes:Rep. HOWARD BERMAN (D, CA-28): Integrating India into a global nonproliferation regime is a positive step. Before anyone gets too sanctimonious about India's nuclear weapons program, we should acknowledge that the five recognized nuclear weapons states have not done nearly enough to fulfill their commitments under the Nuclear Nonproliferation Treaty, including making serious reductions in their own arsenals, nor in the case of the US in ratifying the Comprehensive Test Ban Treaty. Opponent's argument to vote No:Rep. BARBARA LEE (D, CA-9): In withholding my approval, I seek not to penalize the people of India but, rather, to affirm the principle of nuclear nonproliferation. Jettisoning adherence to the international nuclear nonproliferation framework that has served the world so well for more than 30 years, as approval of the agreement before us would do, is just simply unwise. It is also reckless. Approval of this agreement undermines our efforts to dissuade countries like Iran and North Korea from developing nuclear weapons. By approving this agreement, all we are doing is creating incentives for other countries to withdraw from the Nuclear Nonproliferation Treaty. Reference: US-India Nuclear Agreement; Bill HR.7081 ; vote number 2008-S211 on Oct 1, 2008 Voted YES on enlarging NATO to include Eastern Europe. H.R. 3167; Gerald B. H. Solomon Freedom Consolidation Act of 2001, To endorse the vision of further enlargement of the NATO Alliance. Vote to pass a bill that would support further expansion of the North Atlantic Treaty Organization, authorize military assistance to several eastern European countries and lift assistance restrictions on Slovakia. Reference: Bill HR.3167 ; vote number 2002-116 on May 17, 2002 Voted YES on killing a bill for trade sanctions if China sells weapons. Vote to table [kill] an amendment that would require sanctions against China or other countries if they were found to be selling illicit weapons of mass destruction. Reference: Bill HR.4444 ; vote number 2000-242 on Sep 13, 2000 Voted NO on capping foreign aid at only $12.7 billion. Adoption of the conference report on the 2000 Foreign Operations Appropriations Bill provided $12.7 billion for foreign aid programs in 2000. Vetoed by President Clinton Veto message of 10/18/1999: W cannot protect American interests at home without active engagement abroad. We must lead in the world, working with other nations to defuse crises, repel dangers, promote more open economic and political systems, and strengthen the rule of law. This bill rejects all of those principles. The overall funding provided by H.R. 2606 is inadequate. By denying America a decent investment in diplomacy, this bill suggests we should meet threats to our security with our military might alone. That is a dangerous proposition. For if we underfund our diplomacy, we will end up overusing our military. For example, A generation from now, no one is going to say we did too much to help the nations of the former Soviet Union safeguard their nuclear technology and expertise. If the funding cuts in this bill were to become law, future generations would certainly say we did too little and that we imperiled our future in the process. Status: Conf Rpt Agreed to Y)51; N)49 Reference: H.R. 2606 Conference Report; Bill H.R. 2606 ; vote number 1999-312 on Oct 6, 1999 Voted YES on limiting the President's power to impose economic sanctions. To kill a proposal limiting President Clinton's ability to impose economic sanctions on foreign nations. Status: Motion to Table Agreed to Y)53; N)46; NV)1 Reference: Motion to table the Lugar Amdt #3156.; Bill S. 2159 ; vote number 1998-201 on Jul 15, 1998 Voted YES on limiting NATO expansion to only Poland, Hungary & Czech. This amendment would have limited NATO Expansion to only include Poland, Hungary and the Czech Republic. Status: Amdt Rejected Y)41; N)59 Reference: NATO Expansion limit-Warner Amdt. #2322; Bill NATO Expansion Treaty #105-36 ; vote number 1998-112 on Apr 30, 1998 Voted YES on $17.9 billion to IMF. Would provide $17.9 billion for the International Monetary Fund. Status: Amdt Agreed to Y)84; N)16 Reference: McConnell Amdt #2100; Bill S. 1768 ; vote number 1998-44 on Mar 26, 1998 Voted NO on Strengthening of the trade embargo against Cuba. Strengthening of the trade embargo against Cuba. Status: Conf Rpt Agreed to Y)74; N)22; NV)4 Reference: Conference Report on H.R. 927; Bill H.R. 927 ; vote number 1996-22 on Mar 5, 1996 Voted YES on ending Vietnam embargo. Ending U.S. trade embargos on the country of Vietnam. Status: Amdt Agreed to Y)62; N)38 Reference: For. Reltns. Auth. Act FY 94 & 95; Bill S. 1281 ; vote number 1994-5 on Jan 27, 1994 Multi-year commitment to Africa for food & medicine. Leahy co-sponsored the Hunger to Harvest bill: In an effort to reduce hunger in sub-Saharan Africa, urges the President to: set forth five-year and ten-year strategies to achieve a reversal of current levels of hunger and poverty in sub-Saharan Africa, including a commitment to contribute an appropriate U.S. share of increased bilateral and multilateral poverty-focused resources for sub-Saharan Africa, with an emphasis on health (including HIV-AIDS prevention and treatment), education, agriculture, private sector and free market development, democratic institutions and the rule of law, micro-finance development, and debt relief; and work with the heads of other donor countries and sub-Saharan African countries and with private and voluntary organizations and other civic organizations to implement such strategies; and calls for Congress to undertake a multi-year commitment to provide the resources to implement those strategies; and the Administrator of the United States Agency for International Development to report on such implementation. Source: House Resolution Sponsorship 01-HCR102 on Apr 4, 2001 Monitor human rights in Uganda-Sudan crisis. Leahy sponsored the Northern Uganda Crisis Response Act Expresses the sense of Congress that the United States should: support efforts for a peaceful resolution of the conflict in northern and eastern Uganda; work with the Government of Uganda and the international community to make available sufficient resources to meet the relief and development needs of the towns and cities that are supporting large numbers of displaced people; urge the leaders and members of the Lord's Resistance Army to stop the abduction of children, and urge all armed forces in Uganda to stop the use of child soldiers, and seek the release of all individuals who have been abducted; urge the Government of Uganda to improve the professionalism of Ugandan military personnel currently stationed in northern and eastern Uganda, with an emphasis on respect for human rights and civilian protection; work with the international community to assist and increase the capacity of Ugandan civil institutions to monitor the human rights situation in northern Uganda; make clear that the relationship between Sudan and the United States cannot improve unless no credible evidence indicates that authorities of the Government of Sudan are providing support to the Lord's Resistance Army. Became Public Law No: 108-283. Source: Bill sponsored by 9 Senators 04-S2264 on Mar 31, 2004 Increase aid to avert humanitarian crisis in Congo. Leahy co-sponsored increasing aid to avert humanitarian crisis in Congo OFFICIAL CONGRESSIONAL SUMMARY: A bill to promote relief, security, and democracy in the Democratic Republic of the Congo (DRC). Obligates a specified minimum amount under the Foreign Assistance Act, the Agricultural Trade Development and Assistance Act, and the Arms Export Control Act for bilateral assistance programs in the DRC. States that the US should work with other donor nations to increase international contributions to the DRC. Expresses the sense of Congress that the DRC government should exercise control over its Armed Forces, stop the mass rapes by its armed forces, and hold those responsible accountable before an appropriate tribunal; and Expresses the sense of Congress that the US should withhold assistance if the government of the DRC is not making sufficient progress towards accomplishing the policy objectives. SPONSOR'S INTRODUCTORY REMARKS: Sen. OBAMA: There is a country embroiled in conflict that has not yet received the high-level attention or resources it needs. It's the Democratic Republic of Congo, and right now it is in the midst of a humanitarian catastrophe. 31,000 people are dying in the Congo each month and 3.8 million people have died in the previous 6 years. The country, which is the size of Western Europe, lies at the geographic heart of Africa and borders every major region across the continent. If left untended, Congo's tragedy will continue to infect Africa. I believe that the United States can make a profound difference in this crisis. According to international aid agencies, there are innumerable cost-effective interventions that could be quickly undertaken--such as the provision of basic medical care, immunization and clean water--that could save thousands of lives. On the political front, sustained U.S. leadership could fill a perilous vacuum. EXCERPTS OF BILL: LEGISLATIVE OUTCOME:Became Public Law No. 109-456 Source: Congo Relief, Security, and Democracy Promotion Act (S.2125) 05-S2125 on Dec 16, 2005 Impose sanctions and an import ban on Burma. Leahy co-sponsored imposing sanctions and an import ban on Burma A bill to impose sanctions on officials of the State Peace and Development Council in Burma, to prohibit the importation of gemstones and hardwoods from Burma, & to promote a coordinated international effort to restore civilian democratic rule to Burma. (The two Senate versions currently differ in wording). The Saffron Revolution Support Act states that it is U.S. policy to: support the democratic aspirations of Burma's people; condemn the repression carried out by the State Peace and Development Council (SPDC); and hold accountable individuals responsible for the repression of peaceful political activity in Burma. Directs the President to submit to the appropriate congressional committees a list of: SPDC officials who play or have played a substantial role in political repression in Burma or in the commission of human rights abuses; Subjects persons so identified to U.S. entry prohibition and financial sanctions. Amends the Burmese Freedom and Democracy Act of 2003 to prohibit the importation into the US of Burmese gems, teak, or other hardwood timber. Prohibits any U.S. person or corporation from investing in Burma. Introductory statement by Sponsor: Sen. McCAIN. The world has reacted with horror and revulsion at the Burmese junta's recent brutal crackdown against peaceful demonstrators. In crushing the Saffron Revolution, killing hundreds and jailing thousands, including countless Buddhist monks, the junta has left no doubt about its blatant disregard for basic human decency. We, as Americans, stand on the side of freedom, not fear; of peace, not violence; and of the millions in Burma who aspire to a better life, not those who would keep them isolated and oppressed. Our response must go beyond statements of condemnation, and the time to act is now. This legislation imposes meaningful and effective punitive action against the cruel, thuggish, and illegitimate Burmese government. Source: Burma Democracy Promotion Act (S.2257 & S.2172) 07-S2257 on Oct 29, 2007 Implement Darfur Peace Agreement with UN peacekeeping force. Leahy co-sponsored implementing Darfur Peace Agreement with UN peacekeeping force A resolution calling for peace in Darfur. Calls upon the government of Sudan and other signatories and non-signatories to the May 5, 2006, Darfur Peace Agreement to cease hostilities. Calls upon the government of Sudan to facilitate the deployment of the United Nations-African Union peacekeeping force, including any non-African peacekeepers. Urges all invited individuals and movements to attend the next round of peace negotiations without preconditions. Condemns: (1) intimidation or threats against camp or civil society leaders to discourage them from attending the peace talks; and (2) actions by any party that undermines the Darfur peace process. Calls upon all parties to the Comprehensive Peace Agreement to support all terms of the agreement. Legislative Outcome: Resolution agreed to in Senate, by Unanimous Consent. Source: S.RES.455 08-SR455 on Feb 14, 2008 Rated +3 by AAI, indicating pro-Arab pro-Palestine voting record. Leahy scores +3 by AAI on Arab-Israeli issues The Arab American Institute has compiled a Scorecard to catalogue the voting record of the 112th Congress on issues of importance to the Arab American community. Though not comprehensive, we have attempted to provide a snapshot of legislation concerning many of the primary issues concerning Arab Americans. For the Senate, we have included 10 items: two bills on the Arab Spring, three on Palestine, one on Lebanon, one regarding civil liberties, and two for immigration reform. S. Res. 44: (+) calls on former President Hosni Mubarak to immediately begin a peaceful transition to a democratic political system S. Res. 109: (+) honoring and supporting women in North Africa and the Middle East S. Res. 138: (-) calling on the United Nations to rescind the Goldstone report, formally known as the UN Fact Finding Mission on the Gaza Conflict, which accused the Israeli government of targeting Palestinian civilians. S. Res. 185: (-) reaffirming the commitment of the US to a negotiated settlement of the Israeli-Palestinian conflict and calling for a US veto of any UN resolution on Palestinian statehood without a settlement. S. Con. Res. 23: (-) supporting Israel in maintaining defensible borders, and against Israel returning to the armistice lines that existed on June 4, 1967 S. 558: (+) the Cluster Munitions Civilian Protection Act, to limit the use of cluster munitions in areas normally inhabited by civilians. S. 1125: (+) greater judicial review of the Foreign Intelligence Surveillance Act (FISA), and greater protections to individuals being monitored or gag-ordered by the FBI. S.1038, the PATRIOT Sunsets Extension Act, in opposition of PATRIOT Act extension. S. 723: (-) The Birthright Citizenship Act, limiting citizenship for millions of undocumented immigrants born in the US. S. 952: (+) the DREAM Act, allowing undocumented minors to become US citizens, provided they meet certain conditions, including good moral character Source: AAI website 12-AAI-S on May 2, 2012 Integrate gender into diplomatic and foreign aid processes. Leahy co-sponsored Women, Peace, and Security Act Expresses the sense of Congress that: implementation of the US National Action Plan on Women, Peace, and Security (NAP) is paramount in improving the lives of women around the world and increasing global stability and prosperity; It is US policy to implement NAP; The US Agency for International Development (USAID) should integrate gender into diplomatic and strategic and planning processes; federal agencies shall ensure that the tenets of NAP are incorporated into programs for conflict prevention, humanitarian and disaster response, peacekeeping, and democracy promotion; Federal agencies facilitate partner government efforts to improve women's inclusion in peace and security processes, conflict prevention, peace-building and decision-making institutions in conflict-affected environments. White House Summary of NAP, December 2011:The goal of this National Action Plan is as simple as it is profound: to empower half the world's population as equal partners in preventing conflict and building peace in countries threatened and affected by war, violence, and insecurity. Deadly conflicts can be more effectively avoided, and peace can be best forged and sustained, when women become equal partners. The National Action Plan is guided by the following five principles: the engagement and protection of women as agents of peace and stability building on goals for gender integration, gender equality, and women's empowerment guided by the principle of inclusion, seeking out the views and participation of a wide variety of stakeholders--women and girls, men and boys, and members of marginalized groups coordinate among all relevant departments and agencies of the US government, integrated into relevant United States foreign policy initiatives, and enhanced by engagement with international partners be accountable for the implementation of the policies and initiatives endorsed in this Plan. Source: H6255/S3477 12-S3477 on Aug 1, 2012 Supports standing with the nation of israel. Leahy supports the CC survey question on support of Israel The Christian Coalition Voter Guide inferred whether candidates agree or disagree with the statement, 'The U.S. Should Continue to Support and Stand with the Nation of Israel Against her Enemies' The Christian Coalition notes, "You can help make sure that voters have the facts BEFORE they cast their votes. We have surveyed candidates in the most competitive congressional races on the issues that are important to conservatives." Source: Christian Coalition Survey 16_CC14 on Nov 8, 2016 Sanction Mugabe until Zimbabwe transitions to democracy. Leahy co-sponsored sanctioning Mugabe until Zimbabwe transitions to democracy A resolution expressing the sense of the Senate regarding the political situation in Zimbabwe. Expresses the sense of the Senate: supporting the people of Zimbabwe; that the Zimbabwe Electoral Commission should immediately release the legitimate results of the presidential election and ratify the previously announced results of the parliamentary elections; that President Robert Mugabe should accept the will of the people of Zimbabwe in order to effect a timely and peaceful transition to democratic rule; that the U.S. government and the international community should impose targeted sanctions against individuals in the government of Zimbabwe and state security services and militias who are responsible for human rights abuses and election interference; that the U.S. government and the international community should work together to prepare an economic and political recovery package for Zimbabwe; that regional organizations should play an active role in resolving the crisis; and that the U.N. Security Council should support efforts to bring about a peaceful resolution of the crisis and impose an international arms embargo on Zimbabwe until a legitimate democratic government has taken power. Source: S.RES.533&H.RES.1230 2008-SR533 on Apr 24, 2008 Allow travel between the United States and Cuba. Leahy signed Freedom to Travel to Cuba Act Prohibits the President from regulating or prohibiting travel to or from Cuba by U.S. citizens or legal residents or any of the transactions ordinarily incident to such travel, except in time of war or armed hostilities between the United States and Cuba, or of imminent danger to the public health or the physical safety of U.S. travelers. Source: S.428&HR.874 2009-S428 on Feb 12, 2009 Pressure friendly Arab states to end Israeli boycott. Leahy signed Schumer-Graham letter to Secy. Rice from 79 Congress members Dear Secretary Rice, In the past, the lack of sufficient support from [non-participating] Arab states have made it difficult to reach agreements [on the Arab-Israeli conflict]. You should press friendly Arab countries that have not yet done so, to: Participate in the upcoming international meeting and be a full partner of the US in advancing regional peace Take visible, meaningful steps in the financial, diplomatic and political arena to help Palestinian President Abbas govern effectively and meet obligations to fight terror Stop support for terrorist groups and cease all anti-Israel and anti-Jewish incitement Recognize Israel's right to exist and not use such recognition as a bargaining chip for future Israeli concessions End the Arab League economic boycott of Israel in all of its forms Pressure Hamas to recognize Israel, reject terror, and accept prior agreements, and isolate Hamas until it takes such steps. Source: Schumer-Graham letter to Secy. Rice from 79 Congress members 2010-LT-AR on Oct 2, 2007 Click here for definitions & background information on Foreign Policy. Click here for a Wikipedia profile of Patrick Leahy. Click here for a Ballotpedia profile of Patrick Leahy. Click here for SenateMatch quiz answers by Patrick Leahy. Click here for a summary of Patrick Leahy's positions on all issues. Click here for issue positions of other VT politicians. Click here for issue statements from VT primary archives. Click here for issue statements from VT secondary archives. Other candidates on Foreign Policy: Patrick Leahy on other issues: VT Gubernatorial: Christine Hallquist Keith Stern Matt Dunne Phil Scott Rebecca Holcombe Shap Smith Sue Minter VT Senatorial: Al Giordano Brooke Paige John MacGovern Lawrence Zupan Scott Milne VT politicians VT Archives
{ "redpajama_set_name": "RedPajamaCommonCrawl" }
1,575
Q: Expected value of series of uniformly converges random variables Let $X_1,X_2,X_3,...$ a series of i.i.d. variables with $X_i \sim \mathcal{U}(0,1)$. Let $N=\inf\{n\mid \sum_{i=1}^{n}X_i\geq1\}$ Prove that $E(N)=e$. I don't really have a clue how to even start proving that. Can someone please help? Thanks. A: Hints for the steps of a possible procedure: * *Show that $$P(N>t) = P\left(\sum_{i=1}^t x_i<1\right)$$ *Compute the above probability by geometric considerations (volume of a simplex) *Use the property that for a non-negative valued variable $Y$, $E(Y)=\sum_{t=1}^{\infty}{ P(Y\ge t)}$
{ "redpajama_set_name": "RedPajamaStackExchange" }
567
\section{Introduction} Beam hardening artefacts in x-ray computed tomography (CT) of metal hardware frequently limit the diagnostic quality. This applies to large metal objects such as orthopaedic implants as well as smaller samples like tissue-engineered scaffolds. Beam hardening effects are visible in the form of streak artefacts and cupping effects. These artefacts affect the metal and surrounding non-metal regions. During beam hardening, the mean energy of the x-ray beam increases, and dense metal samples can cause severe beam hardening due to reasonably high atomic number as compared to soft tissues. Photon starvation due to the presence of metal hardware further deteriorates the image quality. One common approach is to employ a source filter and preharden the beam, thus removing low energy photons that largely contribute to beam hardening. However, this leads to poor soft tissue contrast. Mathematical correction techniques for beam hardening and metal artefacts have been reported, some of them used in clinical routines. These techniques include sinogram interpolation methods \cite{NMAR, FSMAR}, dual energy extrapolation \cite{monoenergetic}, energy models and polynomial corrections (for $\mu$CT) \cite{bimodal, polynomial}. Some of these post-processing techniques are computationally intense, requiring metal data segmentation and/or several forward and backward projections. Dual energy corrections are usually done at the cost of increased exposure \cite{polynomial}. Photon-counting detectors have been successfully employed in preclinical applications. Using spectral imaging, a novel approach towards minimising beam hardening effects is proposed. To the best of our knowledge, beam hardening and metal artefact reduction using spectral imaging has not been reported. Unlike numerical techniques, the work described in this paper aims at minimising metal artefacts in the acquisition stage, by capturing high energy quanta that exhibit less beam hardening effects. The Medipix ASIC allows simultaneous data acquisition from discrete user-defined energy ranges. The ASIC was designed to count photon events and categorise them based on energy thresholds determined by the user. This feature enables the capture of spectral signatures for multiple materials which can be used for material discrimination. The number of counts for discrete energy bands can be obtained by subtracting data from two counters. This is essentially done as a pre-processing step prior to flat-field normalization and reconstruction. The raw data from a counter has an energy range between [$T_{C}$, kVp], where $T_{C}$ is the corresponding user-defined threshold and kVp is the x-ray tube potential used. Since the count information is acquired simultaneously in a single exposure, the noise in a particular energy range is local Poisson noise due to quantum fluctuations. Reduction in streak artefacts using spectral imaging of a scaffold sample is shown in figure \ref{compare}. Wide energy acquisition shows severe streaks while narrow high energy range exhibits reduced artefacts. Also, spatial improvements corresponding to the metal region can be noticed in the narrow energy band while the wide energy reconstruction shows a blooming effect. \begin{figure}[h!] \begin{center} \subfloat[15 to 80 keV]{\label{15to80comp}\includegraphics[width=0.35\linewidth]{Ti_15to80c.png}} \subfloat[55 to 80 keV]{\label{55to80comp}\includegraphics[width=0.35\linewidth]{Ti_55to80c.png}} \end{center} \caption{Metal scaffold sample imaged using Medipix3RX. High energy range shows reduced artefacts compared to wide energy acquisition.} \label{compare} \end{figure} The earlier Medipix detectors had technical challenges relating to charge sharing effects which is prominent when pixel pitch less than 300 $\mu$m is used. Charge sharing is when the total charge from a single photon event is split across several pixels and individual pixels counted them as seperate events thereby affecting spatial and spectral resolution. To overcome this problem, the new Medipix3RX enables a fully operational charge summing mode (CSM) \cite{3RX}. During charge sharing, a single event across multiple pixels are identified through inter-pixel communication. The charge from 2 x 2 pixel region is summed and the pixel receiving the highest charge from the event is alloted the summed total charge. This can be termed as `photon-processing'. A chip without CSM would count each of these pixels as a separate photon, each with a reduced energy. In addition to CSM, there is spectroscopic mode, which allows inter-pixel communication to multiplex the 2 counters per pixel over a 2 x 2 pixel area (110 x 110 $\mu$m$^2$), giving 8 possible counters. When spectroscopic mode and CSM are enabled, the 110 x 110 $\mu$m$^2$ area pixels are checked with their neighbours, summing the charge over an area of 220 x 220 $\mu$m$^2$. This leads to a spatial arrangement of 128 x 128 pixel clusters at 110 $\mu$m pitch with each pixel cluster providing 4 CSM counters (and 4 arbitrated but non-CSM counters). High-Z sensor layers like cadmium telluride (CdTe) are preferred for clinical applications due to their ability to operate in wider energy ranges \cite{CdTe}. A silicon (Si) sensor layer is suitable for soft-tissue imaging in small animals, but has poor detection efficiency over the full diagnostic x-ray range. Due to low absorption efficiencies \cite{Medipix3.1}, Si becomes virtually transparent to hard x-rays, which are required for CT of large objects, for metal artefact reduction and for clinical applications involving gold or gadolinum K-edge imaging. The quantum detection efficiency of CdTe is suitable for operation in human diagnostic x-ray range (20 to 140 keV). This article discusses the initial experiments using CdTe sensor in Medipix3RX ASIC for studying beam hardening effects and metal artefact reduction in the x-ray energy range of 15 to 80 keV. Metal samples of titanium (Ti) and magnesium (Mg) alloys \cite{Mg_porous} that are used in tissue engineering research were used in this study. Porous scaffolds of these metals are usually implanted in bone to study bone ingrowth \cite{boneingrowth1, boneingrowth2}. \section{Materials and Methods} For the beam hardening study, we used Medipix All Resolution System (MARS) \cite{firstCT} containing a Medipix3RX ASIC with a 2 mm CdTe sensor bump bonded at 110 $\mu$m in a single chip layout. All the acquisitions in this paper were carried out in CSM. The detector assembly is a module of the MARS camera which also contains a readout board, peltier cooling system and an integrated bias-voltage board. A negative bias voltage of -440 V was applied across the sensor during the acquisitions. The MARS scanner system comprises of MARS camera, a rotating internal gantry and an 80 kVp Source-Ray SB-80-1K x-ray tube (Source-Ray Inc, Ronkonkoma, NY) with a tungsten anode having 1.8 mm aluminium (Al) equivalent intrinsic filtration. The focal spot size is approximately 33 $\mu$m \cite{sourceray}. Mechanical motor control (gantry rotation, source to detector translation, camera translation and sample translation), detector energy response calibration and threshold equalization were performed using the custom built MARS scanner software. The samples used in this study are shown in figure \ref{scaffold_pic} and its description is provided in table \ref{sampledesc}. \begin{table}[ht] \caption{Sample description} \centering \begin{tabular}{c c p{7cm}} \hline\hline Sample & Material & \centerline{Description}\\ \hline Metal phantom & Ti alloy & Solid cylinder of 8 mm diameter press fitted onto a Perspex cylinder of 25 mm diameter to study cupping effect. \\ Porous scaffold & Ti alloy & Porous 3D lattice structure fabricated via electron beam melting with $\approx$700 $\mu$m thick struts. Used in tissue engineering research. \\ Porous scaffold & Mg alloy & Porous 3D lattice structure fabricated via an indirect additive manufacturing process in molten Mg with $\approx$500 $\mu$m thick struts. Used in tissue engineering research \cite{Mg_porous}. \\ Porous mesh (stent-like pattern) & Ti alloy & Porous 3D structure fabricated via selective laser sintering with variable strut thickness between 620 $\mu$m and 670 $\mu$m. Sample length measures 45 mm (includes a 10 mm base). \\ [1ex] \hline \end{tabular} \label{sampledesc} \end{table} \begin{figure}[h!] \begin{center} \subfloat[Ti scaffold]{\label{Ti_pic}\includegraphics[width=0.21\linewidth]{Ti_snap.png}} \subfloat[Mg scaffold]{\label{Mg_pic}\includegraphics[width=0.223\linewidth]{Mg_snap.png}} \subfloat[Ti mesh]{\label{Ti_mesh_pic}\includegraphics[width=0.148\linewidth]{vase_snap.png}} \end{center} \caption{Snapshots of the metal samples (see table 1 for scale information).} \label{scaffold_pic} \end{figure} \subsection{Spectral scan parameters} The scanner gantry was set to continuous-motion rotation to acquire projections at multiple camera positions. The CSM thresholds were set to 15, 35, 55 and 62 keV. All the samples were mounted in air during the spectral scans. The MARS camera was translated vertically to cover the entire diameter of the sample. The geometric parameters (source to detector distance (SDD) and source to object distance (SOD)) and x-ray tube settings are provided in table \ref{settings}. \begin{table}[ht] \caption{Scan parameters} \centering \begin{tabular}{c c c c c c} \hline\hline Sample & SOD (mm) & SDD (mm) & Voltage (kVp) & Current ($\mu$A) & Exposure time (ms) \\ [0.5ex] \hline Ti phantom & 131.8 & 163.8 & 80 & 80 & 50\\ Ti scaffold & 131.8 & 170.8 & 80 & 90 & 40 \\ Mg scaffold & 131.8 & 170.8 & 80 & 90 & 40 \\ Ti mesh & 110 & 144 & 80 & 80 & 40\\ [1ex] \hline \end{tabular} \label{settings} \end{table} \subsection{Post processing chain} The raw data acquired from the scanner were flat-field normalized using open beam projections (500 open beam projections per camera position per counter acquired prior to scan). Dark-field images (50 dark-fields) were acquired prior to scan for dark-field (bad pixel) correction. A projection space statistical ring filter loosely based on \cite{ring} was applied prior to reconstruction. The projections were reconstructed using MARS-ART (Algebraic Reconstruction Technique) algorithm \cite{tangART}. Number of projections per gantry rotation was set to 720. Volumetric rendering was performed using MARS - Exposure Render, which is a modified version of the open-source Exposure Render \cite{erender} software that implements a direct volume rendering (DVR) algorithm. Modifications to Exposure Render include the addition of tricubic B-spline interpolation between data voxels, the ability to simultaneously visualise up to 8 volumetric datasets, and numerous user interface changes. \section{Results and Discussion} Figure \ref{phantom} shows a single slice spectral reconstruction of the Ti phantom. The cupping effect is prominent in the low energy range and decreases in the high energy acquisitions. The thresholds were determined to provide a trade-off between reduced photon noise and cupping effect. The spectral images for the energy ranges 55 to 80 keV and 62 to 80 keV exhibit reduced cupping effect while the 15 to 80 keV reconstruction has low quantum noise and shows good contrast in non-metal regions. In figure \ref{line}, a horizontal line profile passing through the origin of the metal cylinder shows cupping effect in the different energy ranges. Without the use of any hardware filters, a significant reduction in the cupping effect is noticeable in figure \ref{55to80L}. The reconstruction corresponding to the energy range from 62 to 80 keV suffers from severe photon limitation giving rise to statistical noise. Any significant increase in tube current and/or exposure time for this scan resulted in detector saturation in non-metal regions. \begin{figure}[h!] \begin{center} \subfloat[15 to 80 keV]{\label{15to80P}\includegraphics[width=0.22\linewidth]{Ti_phantom_collage_15-80.png}} \subfloat[35 to 80 keV]{\label{35to80P}\includegraphics[width=0.22\linewidth]{Ti_phantom_collage_35-80.png}} \subfloat[55 to 80 keV]{\label{55to80P}\includegraphics[width=0.22\linewidth]{Ti_phantom_collage_55-80.png}} \subfloat[62 to 80 keV]{\label{62to80P}\includegraphics[width=0.22\linewidth]{Ti_phantom_collage_62-80.png}} \end{center} \caption{Spectral reconstruction of Ti cylindrical phantom. High energy ranges shows reduced cupping effect.} \label{phantom} \end{figure} \begin{figure}[h!] \begin{center} \subfloat[15 to 80 keV]{\label{15to80L}\includegraphics[width=0.52\linewidth]{lineprofile1.png}} \subfloat[35 to 80 keV]{\label{35to80L}\includegraphics[width=0.52\linewidth]{lineprofile2.png}} \subfloat[55 to 80 keV]{\label{55to80L}\includegraphics[width=0.52\linewidth]{lineprofile3.png}} \subfloat[62 to 80 keV]{\label{62to80L}\includegraphics[width=0.52\linewidth]{lineprofile4.png}} \end{center} \caption{Normalized line profiles for Ti cylindrical phantom. Cupping effect can be seen in (a) and (b) but much reduced in (c) and (d).} \label{line} \end{figure} Figure \ref{Tiscaffold} illustrates a single slice spectral reconstruction of the Ti scaffold. Varying levels of streak artefacts can be seen across the spectral reconstructions. The spectral reconstructions for the energy ranges 35 to 80 keV, 55 to 80 keV, and 62 to 80 keV shown in figure \ref{Tiscaffold}, exhibit reduced streak artefacts. A region-of-interest (ROI) analysis was performed in the immediate vicinity of the metal region where the streaks are more pronounced. Average attenuation coefficent of air close to zero conveys less regional noise/artefacts. The regional average attenuation coefficient ($\mu_{ROI}$) of the non-metal (air) region in 55 to 80 keV reconstruction (figure \ref{roi3}) shows reduced artefacts. Even though minor streaks and statistical noise appear in figure \ref{roi4} due to photon limitation, the artefacts are less pronounced in comparison to the wide energy acquisition in figure \ref{roi1}. \begin{figure}[h!] \begin{center} \subfloat[15 to 80 keV]{\label{roi1}\includegraphics[width=0.25\linewidth]{Ti_15to80.png}} \subfloat[35 to 80 keV]{\label{roi2}\includegraphics[width=0.25\linewidth]{Ti_35to80.png}} \subfloat[55 to 80 keV]{\label{roi3}\includegraphics[width=0.25\linewidth]{Ti_55to80.png}} \subfloat[62 to 80 keV]{\label{roi4}\includegraphics[width=0.248\linewidth]{Ti_62to80.png}} \end{center} \caption{Single slice spectral reconstruction of Ti scaffold sample. $\mu_{ROI}$ is 0.246, 0.030, 0.008 and 0.103 for the circular ROI in (a), (b), (c) and (d) respectively.} \label{Tiscaffold} \end{figure} Using the Ti scaffold sample, a post reconstruction analysis between Si detector (Medipix3.1) operating in Single Pixel Mode (SPM) and CdTe detector (Medipix3RX) operating in CSM was carried out. Figure \ref{Si} shows a reconstruction for energy range 30 to 50 keV obtained using Si detector with a detector element size 55 $\mu$m in SPM. Despite good spatial resolution, artefacts are still prominent. The reconstruction using CdTe detector with a detector element size of 110 $\mu$m in CSM (figure \ref{CdTe}) shows reduced artefacts comparatively. To obtain the narrow energy range of 35 to 55 keV, the raw counts at 35 to 80 keV and 55 to 80 keV were subtracted. \begin{figure}[h!] \begin{center} \subfloat[30 to 50 keV using Si]{\label{Si}\includegraphics[width=0.25\linewidth]{Si.png}} \subfloat[35 to 55 keV using CdTe]{\label{CdTe}\includegraphics[width=0.25\linewidth]{CdTe.png}} \end{center} \caption{Ti scaffold reconstruction using Si Medipix3.1 and CdTe Medipix3RX.} \label{Ti_Si_CdTe} \end{figure} Figure \ref{fig6:main} shows a single slice spectral reconstruction of the Mg scaffold. Due to low atomic number of Mg (Z = 12) compared to Ti (Z = 22), the results did not exhibit any significant beam hardening effects. Low energy reconstruction shows good spatial information while high energy ranges are limited by photon noise. In scans involving smaller samples made from low-Z materials like Al or Mg, acquiring low energy quanta in CSM provide high spatial information with minimum or no beam hardening effects. Figure \ref{meshrec} illustrates a single slice spectral reconstruction of the Ti mesh. Similar to the Ti scaffold, streaks are less pronounced in the mid and high energy ranges. \begin{figure}[h!] \begin{center} \subfloat[15 to 80 keV]{\label{15to80M}\includegraphics[width=0.25\linewidth]{MG1.png}} \subfloat[35 to 80 keV]{\label{35to80M}\includegraphics[width=0.25\linewidth]{MG2.png}} \subfloat[55 to 80 keV]{\label{55to80M}\includegraphics[width=0.25\linewidth]{MG3.png}} \subfloat[62 to 80 keV]{\label{62to80M}\includegraphics[width=0.25\linewidth]{MG4.png}} \end{center} \caption{Spectral reconstruction of Mg scaffold. Low energy ranges provide good spatial resolution while high energy ranges are limited by photon noise.} \label{fig6:main} \end{figure} \begin{figure}[h!] \begin{center} \subfloat[15 to 80 keV]{\label{15to80v}\includegraphics[width=0.25\linewidth]{15to80V.png}} \subfloat[35 to 80 keV]{\label{35to80v}\includegraphics[width=0.25\linewidth]{35to80V.png}} \subfloat[55 to 80 keV]{\label{55to80v}\includegraphics[width=0.25\linewidth]{55to80V.png}} \subfloat[62 to 80 keV]{\label{62to80v}\includegraphics[width=0.25\linewidth]{62to80V.png}} \end{center} \caption{Spectral reconstruction of Ti mesh sample. Minor streaks are visible in the low energy range.} \label{meshrec} \end{figure} \section{Summary and Conclusion} Beam hardening and metal artefacts pose challenges during CT imaging in the presence of metal hardware \cite{CTartifact}. This paper presents data that demonstrates the use of spectral imaging in reducing beam hardening effects and metal artefacts. A high-Z sensor layer like CdTe is necessary to provide improved spectral resolution at higher x-ray energies needed for typical implant visualisation. Multi-energy acquisition of metal samples has the added advantage of capturing spectral information which exhibits reduced artefacts and reasonable non-metal (tissue) information. Further, the results were obtained without any hardware filters (except for the intrinsic filter-equivalent in the x-ray tube) and without any numerical corrections. A global reduction in noise due to charge sharing effects was seen due to the availability of CSM. 3D visualisation of the samples (figure \ref{exposnap}) revealed finer spatial structures. \begin{figure}[h!] \begin{center} \subfloat[Porous Ti scaffold]{\label{Tiscaff}\includegraphics[width=0.32\linewidth]{Tiscaff.png}} \subfloat[Mg scaffold]{\label{Mgscaff}\includegraphics[width=0.328\linewidth]{Mgscaff.png}} \subfloat[Ti mesh]{\label{mesh}\includegraphics[width=0.308\linewidth]{mesh.png}} \end{center} \caption{High resolution MARS-Exposure Render visualisation of the metal samples} \label{exposnap} \end{figure} Further improvements in metal artefact reduction should be achieved by (i) increasing the tube potential from 80 kVp to 120 kVp and (ii) numerical correction methods by using a reference energy range where artefacts are minimal. ART plays an important role while reconstructing datasets with low photon counts. Pixels that receive no photons are treated as dead pixels and the corresponding equations are ignored during the algebraic reconstruction, a technique that is not possible in conventional filtered back projection reconstruction. This helps in avoiding secondary artefacts due to incomplete data. Sinograms are not used since MARS-ART directly operates on individual projection frames. Different metal samples and scaffold structures are currently being studied using the MARS spectral imaging modality. Tissue ingrowth quantification using imaging techniques will help identify the biocompatibility of scaffold materials. The quality of information derived from conventional CT imaging are limited by beam hardening effects. Spectral imaging has helped identify energy ranges that are less prone to beam hardening effects and provide improved visualisation in the absence of artefacts. In conclusion, high-Z detectors such as CdTe operating in CSM outperform Si detectors for beam hardening and artefact reduction using high energy x-ray range. The raw data (dicom files), pre-processed projection images and the reconstructions can be obtained from \href{http://hdl.handle.net/10092/8627}{http://hdl.handle.net/10092/8627} for readers to test the data using their familiar routines. \acknowledgments This project was funded by Ministry of Business, Innovation and Employment (MBIE), New Zealand under contract number UOCX0805. The authors would like to thank all members of MARS-CT project, the Medipix2 collaboration, and the Medipix3 collaboration. In particular we acknowledge the CERN based designers Michael Campbell, Lukas Tlustos, Xavier Llopart, Rafael Ballabriga and Winnie Wong, and the Freiburg material scientists Michael Fiederle, Alex Fauler, Simon Procz, Elias Hamann and Martin Pichotka. We also thank Graeme Kershaw, University of Canterbury for preparing the hardware phantom, and Anton Angelo, University of Canterbury for co-ordinating access to the data repository. \bibliographystyle{jhep}
{ "redpajama_set_name": "RedPajamaArXiv" }
5,259
Rambling Mom: Fall Y'all Bloggy Giveaway! how adorable! count me in!!! The hats are very very very cute!!! I'd love to win one for my niece and my kids!! I love crotched hats! Count me in, too! Your things are beautiful!! Please enter me. So cute! I would love a hat like that! Oh my goodness I would love this! HOw cute is that hat! woo hoo!! I just love the pumpkin hat! When I saw your name I was hoping you were giving away some of your cute hats!! I'd love this! Please count me in! Adorable!! COunt me in please! I love, love the little boy hat with blue kind of stripes with white! Adorable! I like the Stylin' Cap in pink for my 5 y.o.! She would love it. The stylin' cap is adorable! Awesome giveaway! I would love to win! Thanks so much! I like the stylish hats, they would make for cute pictures. Thank you for sharing such talent. count me in !!! Please!!! Love this!!! Please enter me. I love your pumpkin hats! Adorable and very affordable! I hope I win! The winter hat, complete with edging and pompom. Adorable. I really like the stylin cap-very cute! I love the pumpkin hat for a toddler! Would it look funny in green? If so, the color shown is cute too! I love everything handmade! Please count me in! Please enter me! My 4 yr old needs a new hat! Oh I would LOVE to win one of these pumpkin hats for a friend who's pregnant right now! So cute. What a cute hat & website! Sweet hats! And, handmade! :-) Thanks for offering them! My kids could so use hats. It is so cold here right now. I have my sweatshirt on and socks. I hate cold weather by the way. I love the pink Stylin' Cap! Cute! And cute. I'd like to enter. I'd love a winter hat with a little pom pom on it. You may find craftshowconnection beneficial to your crocheting business. I have a banner on my right sidebar with the link. Enter me please! I'm due for the coldest winter I've ever had - living in a new state. Thanks! Those are really nice . Please enter me - its about to get cold here in Texas!! LOVE the stylin' cap! Count me in! These are adorable! They look so warm and cozy...Keeping my fingers crossed for my son! I like the Winter Hat for my little one on the way! I really liked the bright pink hat!! Your blanket are beautiful too!!Such talent! Beautiful stuff. Great giveaway, so count me in! Good luck everyone! Thanks so much for the chance to win! They are lovely!!! I love them all, especially the Pumpkin hat. How to make them stay on Kiddo's head will be the real challenge! I need to learn how to do this! In the meantime, count me in! Thanks. Count me in! I love the stylin' hat as well as the pumpkin one! Beautiful! They are all so cute!! Count me in! So cute!! Please enter me. My little Avery Rose just needs one of those little hats! Then she can pass it on to her little cousins to be born next spring! Cute cute hats! I'd either get a winter cap for my baby or a stylin' cap for me! ooooh! Please count me in! so beautiful, they make me want to start knitting and crocheting again. SO so cute! I wish I was that talented! Count me in! I would love to win the Stylin' Cap in white! Please count me in. Thanx! Email is in my profile! You're so talented! Your site is very nice. That pumpkin hat is really adorable. Please enter me in your giveaway. Thanks! Super cute . . . this would be adorable on my little guy!!! Thanks for the giveaway! SOOO cute. Pleas eenter me! Beautiful hats! Please count me in. So cute. Please count me in. Great giveaway! How cute! I'm having a baby girl in March and would love a sweet hat for her. Count me in! I love the sweet lace baby blanket but the pumpkin hat is my favorite hat. So cute! My 2 year old would love the stylin' cap. Sylin' and pumpkin are my favorites. We love hats around here! Thank you, your work is so cute and fun! so so cute! come visit me too! My little one doesn't have a whole of of hair so i have been needing a hat for his cute little head!! Thanks for sharing. You rock! Cute!! Please count me in! You're stylin' cap is so cute! You do great work! Please enter my name in your contest. Thanks!
{ "redpajama_set_name": "RedPajamaC4" }
461
{"url":"https:\/\/www.mathtrench.com\/probability-other-probability-problems-29191\/","text":"# Probability: Other Probability Problems \u2013 #29191\n\nQuestion: How many more letter arrangements are possible for letters (A, B, B, X) than the letters (A, B, B)?","date":"2021-03-08 22:39:10","metadata":"{\"extraction_info\": {\"found_math\": false, \"script_math_tex\": 0, \"script_math_asciimath\": 0, \"math_annotations\": 0, \"math_alttext\": 0, \"mathml\": 0, \"mathjax_tag\": 0, \"mathjax_inline_tex\": 0, \"mathjax_display_tex\": 0, \"mathjax_asciimath\": 0, \"img_math\": 0, \"codecogs_latex\": 0, \"wp_latex\": 0, \"mimetex.cgi\": 0, \"\/images\/math\/codecogs\": 0, \"mathtex.cgi\": 0, \"katex\": 0, \"math-container\": 0, \"wp-katex-eq\": 0, \"align\": 0, \"equation\": 0, \"x-ck12\": 0, \"texerror\": 0, \"math_score\": 0.8614652156829834, \"perplexity\": 2111.7170467176643}, \"config\": {\"markdown_headings\": true, \"markdown_code\": true, \"boilerplate_config\": {\"ratio_threshold\": 0.18, \"absolute_threshold\": 10, \"end_threshold\": 15, \"enable\": true}, \"remove_buttons\": true, \"remove_image_figures\": true, \"remove_link_clusters\": true, \"table_config\": {\"min_rows\": 2, \"min_cols\": 3, \"format\": \"plain\"}, \"remove_chinese\": true, \"remove_edit_buttons\": true, \"extract_latex\": true}, \"warc_path\": \"s3:\/\/commoncrawl\/crawl-data\/CC-MAIN-2021-10\/segments\/1614178385529.97\/warc\/CC-MAIN-20210308205020-20210308235020-00120.warc.gz\"}"}
null
null
using System; using System.Collections.Concurrent; using System.Collections.Generic; using System.Globalization; using System.IO; using System.Linq; using System.Reflection; using System.Text; using System.Threading; using System.Threading.Tasks; using Antlr.Runtime; using Generator.AstNodes; using Generator.Meta; using ICSharpCode.NRefactory.Utils; using Mono.Options; namespace Generator { static class Program { public class Arguments { public string OutputDirectory { get; set; } public List<string> Sources { get; private set; } public List<string> RootNamespaces { get; private set; } public string Metadata { get; set; } public Arguments() { Sources = new List<string>(); RootNamespaces = new List<string>(); } } public static IEnumerable<string> Split(string str, Func<char, bool> controller) { int nextPiece = 0; for (int c = 0; c < str.Length; c++) { if (controller(str[c])) { yield return str.Substring(nextPiece, c - nextPiece); nextPiece = c + 1; } } yield return str.Substring(nextPiece); } public static string TrimMatchingQuotes(string input, char quote) { if ((input.Length >= 2) && (input[0] == quote) && (input[input.Length - 1] == quote)) return input.Substring(1, input.Length - 2); return input; } public static IEnumerable<string> SplitCommandLine(string commandLine) { bool inQuotes = false; return Split(commandLine, c => { if (c == '\"') inQuotes = !inQuotes; return !inQuotes && c == ' '; }) .Select(arg => TrimMatchingQuotes(arg.Trim(), '\"')) .Where(arg => !String.IsNullOrEmpty(arg)); } static int Main(string[] args) { Thread.CurrentThread.CurrentCulture = CultureInfo.InvariantCulture; try { var actualArgs = new List<string>(); foreach (var arg in args) { if (arg.Length > 0 && arg[0] == '@') { string content; string filename = arg.Substring(1); try { filename = Path.GetFullPath(filename); content = File.ReadAllText(filename); } catch (IOException ex) { throw new OptionException("Error reading parameter file " + filename + ": " + ex.Message, "@"); } actualArgs.AddRange(SplitCommandLine(content)); } else { actualArgs.Add(arg); } } bool showHelp = actualArgs.Count == 0; var metadataFiles = new List<string>(); var parsedArgs = new Arguments(); var opts = new OptionSet { { "?|help", v => showHelp = true }, { "o|out=", v => parsedArgs.OutputDirectory = v }, { "r|root=", v => parsedArgs.RootNamespaces.Add(v) }, { "m|meta=", v => metadataFiles.Add(v) }, }; var sources = opts.Parse(actualArgs); if (showHelp) { Console.WriteLine("Web source generator"); Console.WriteLine("Usage: " + Path.GetFileNameWithoutExtension(Assembly.GetEntryAssembly().Location) + " options source-files"); Console.WriteLine(); Console.WriteLine("Options:" ); Console.WriteLine(" --help, -? Show this message." ); Console.WriteLine(" --meta, -m Use the specified metadata file (mandatory, can be more than one)."); Console.WriteLine(" --out, -o Specifies the output directory (mandatory)."); Console.WriteLine(" --root, -r Adds a root namespace (a namespace that doesn't create a subdirectory)."); Console.WriteLine(" @file Treat the file as if its entire content were passed on the command line."); } else { if (String.IsNullOrEmpty(parsedArgs.OutputDirectory)) { throw new OptionException("The output directory (-o) must be specified (use the option -? for help).", "out"); } try { parsedArgs.OutputDirectory = Path.GetFullPath(parsedArgs.OutputDirectory); Directory.CreateDirectory(parsedArgs.OutputDirectory); } catch (IOException ex) { throw new OptionException("Error creating output directory + " + parsedArgs.OutputDirectory + ": " + ex.Message, "out"); } if (metadataFiles.Count == 0) { throw new OptionException("The metadata file (-m) must be specified (use the option -? for help).", "out"); } var sb = new StringBuilder(); foreach (var f in metadataFiles) { try { sb.AppendLine(File.ReadAllText(f)); } catch (IOException ex) { throw new OptionException("Error reading file + " + parsedArgs.OutputDirectory + ": " + ex.Message, "out"); } parsedArgs.Metadata = sb.ToString(); } foreach (var src in sources) { string filename = src; try { filename = Path.GetFullPath(filename); using (File.OpenRead(filename)) { // just verify that it is possible } parsedArgs.Sources.Add(filename); } catch (IOException ex) { throw new OptionException("The file " + filename + " could not be opened: " + ex.Message, "source"); } } return Process(parsedArgs) ? 0 : 1; } } catch (OptionException ex) { Console.Error.WriteLine(ex.Message); return 1; } return 0; } private static Tuple<IReadOnlyList<Definitions>, IReadOnlyList<string>> Parse(IReadOnlyList<string> files) { var errors = new ConcurrentStack<string>(); var allParts = new Definitions[files.Count]; Parallel.ForEach(files, (file, _, i) => { try { allParts[i] = WebIDLParser.Parse(new StreamReader(file, Encoding.UTF8)); } catch (IOException ex) { errors.Push("Error reading file " + file + ": " + ex.Message); } catch (RecognitionException ex) { errors.Push(file + "(" + ex.Line + ":" + ex.CharPositionInLine + "): " + ex.GetType().Name + ": " + ex.Message); } }); return Tuple.Create<IReadOnlyList<Definitions>, IReadOnlyList<string>>(allParts, errors.ToList()); } private static bool Process(Arguments args) { var parseResult = Parse(args.Sources); if (parseResult.Item2.Count > 0) { foreach (var e in parseResult.Item2) Console.Error.WriteLine(e); return false; } var metadata = MetadataParser.Parse(args.Metadata); if (metadata.Item2.Count > 0) { foreach (var e in metadata.Item2) Console.Error.WriteLine(e); return false; } var resolvedDefinitionsAndErrors = WebIDLResolver.Resolve(parseResult.Item1); if (resolvedDefinitionsAndErrors.Item2.Count > 0) { foreach (var e in resolvedDefinitionsAndErrors.Item2) Console.Error.WriteLine(e); return false; } var model = Converter.BuildCSharpModel(resolvedDefinitionsAndErrors.Item1, metadata.Item1); if (model.Item2.Count > 0) { foreach (var e in model.Item2) Console.Error.WriteLine(e); return false; } var generated = model.Item1.Select(t => Tuple.Create(t.Namespace, t.EntityDeclaration.Name, Formatter.Format(t))).ToList(); var errors = new ConcurrentStack<string>(); Parallel.ForEach(generated, c => { var rootLength = args.RootNamespaces.DefaultIfEmpty("").Max(r => c.Item1 == r ? c.Item1.Length : (c.Item1.StartsWith(r + ".") ? r.Length + 1 : 0)); string filepath = Path.Combine(args.OutputDirectory, c.Item1.Substring(rootLength).Replace('.', Path.DirectorySeparatorChar), c.Item2 + ".cs"); try { Directory.CreateDirectory(Path.GetDirectoryName(filepath)); File.WriteAllText(filepath, c.Item3, Encoding.UTF8); } catch (IOException ex) { errors.Push("Error writing file " + filepath + ": " + ex.Message); } }); if (errors.Count > 0) { foreach (var e in model.Item2) Console.Error.WriteLine(e); return false; } return true; } } }
{ "redpajama_set_name": "RedPajamaGithub" }
647
Борис I, или понекад Михаило (), је био владар Бугарске између 852. и 889. године. Име и титуле Борис је 864. прихватио хришћанство и на свом крштењу је као врховни хришћански чин узео име свог кума, византијског цара Михаила III, па се понекад у историјским истраживањима назива и Борис-Михаило. Једини директни запис Борисове титуле се може наћи у Балшинском запису који је написан код данашњег албанског села Балши. Тамо је назван архонт Бугарске што се обично преводи са цар, а у 10. веку је назван кназем. Из бугарским записима Борис је обично називан књазем ("кънѧѕь"), а током трајања Другог бугарског царства - цар. Према другим теоријама Борис је имао следеће титуле: кан, цар или књаз. Мада друга теорија негира да је имао титулу кан, јер се титула кан није употребљавала још од кана Аспаруха. Криза у средњој Европи Од почетка 9. века почело је у Европи да се осећа ривалство између Католичке цркве у Риму и Православне цркве у Константинопољу. Када се Карло Велики прогласио за цара Франачког царства папа је одмах прекинуо све политичке односе са Византијом и због тога је био подржан од стране Франака. После Верденског споразума 843. године, Источна Франачка (касније Немачка) је почела да води агресивнију политику у Европи. Почели су да шире своју државу ка истоку међу Словене, а папа их је збого овога подржао, јер је међу Словене видео нове католичке поданике. Као одговор на ова освајања Мојмир I је ујединио све словенске кнезове и оформио Великоморавску кнежевину. Његов наследник Ратислав се борио против Немаца. Обе државе су покушавале да имају добре односе са Бугарском због њене велике војне надмоћи. Војни походи Борис је био син и наследник Пресијана. Године 852. шаље дипломате у Источној Франачкој како би потврдио мир из 845. године. Када је наследио свог оца имао је велику војску и силу да нападне Византију, али није напао. Због тога му Византијци дају малу регију на југоистоку звану Странџа. Мир није потписан, и ако су обе стране привремено промениле своје делегације. Године 854. моравски кнез Ратислав му помаже у борби против Источне Франачке. Према неким изворима неки франачки феудалци су нахушкали Бориса да нападне Лудвига I. Бугарско-словенска кампања је била катастрофа и Лудвиг је брзо поразио бугарску војску и напао саму Бугарску. У исто време Хрвати почињу рат са Бугарском и нападају је. Према неким изворима сматра се да је Лудвиг платио Хрватима да нападну Бугарску, како би они замајавали Бориса, док се усредсреде на Велику Моравску. Пошто Борис није имао никаквог успеха, обе стране су потписале мир и повукле преостале војске. Због војних акција и мира који су потписали Борис и Лудвиг, Ратислав је морао да се бори против Франака сам. Сукоб са Византијом започео је 855—866, а Пловдив и неке тврђаве на Црном мору заузео је Михаило III. После смрти Властимира око 850. године, његови синови су поделили српске земље. Борис одлучује да нападне српске земље. Циљао је да смањи утицај Византије на ове мале српске земље. Кампања је неуспела, јер су Срби заробили његовог сина Владимира и дванаест великих бољара. Борис се нагодио са Србима и даровао их је, да би они ослободили његовог сина. И поред свих ратних неуспеха Борис је ипак сачувао своје царство. Крштење Из непознатих разлога Борис је био заинтересован за хришћанство. Године 863. је хтео да од Лудвига прими групу свештеника и да се покрсте. Међутим, касније те године Византија је напала Бугарску током временских непогода и тада је Борис прихватио да се покрсти по Византијским обичајима и да да Тракију (то је у ствари Загора коју је Борис повратио исте године). Почетком 864. године Борис се тајно крстио у Плиски заједно са својом породицом и део племића. Цар Михаило III му је био кум, а он је узео име Михаило. Међутим у Балшинском запису пише:"... крштен је арконт Бугарски Борис, назван је Михаило, јер је народу дао Бог, година:6374 (866.) (). После његовог крштења његовим стопама су кренули и други бугарски племићи, а после њих и остатак народа. Међутим, нису сви подржавали ширење хришћанства у Бугарској, па су се неколико угледних бољара побунила против Михаила. Михаило је сурово угушио побуну и убио 55 бољара заједно са њиховим породицама. Бугарска црква У исто време када је био крштен, Борис (сада Михаило) тражио је начин да стекне аутокефалност од константинопољског патријаха Фотија. Патријарх Фотије је био огорчен на Бориса, па је Борис хтео више репутације код папе. Борис је послао дипломате код Папе Николе I 866. Са дугом листом о томе како водити једну цркву. Добио је 106 одговора о томе како водити религију, политику, обичајима и закону. Папа је неко време затворио око контроверзног питања о аутокефалности Бугарске и послао је мисионаре да крсте Бугаре по западним обичајима. Ово је изнервирало Фотија и он је написао дугу литургију 867. о томе како се одбацују сва крштења која обаве западни мисионари. Референце Литература Спољашње везе Бугарска историја-Борис Константинопољска патријаршија Николов, А. Идея о благочестии и мудрости правителя в политической идеологии и публичной пропаганде болгарских государей в первое столетие после принятия христианства в Болгарии (864—971). – В: XVII Ежегодная богословская конференция Православного Свято-Тихоновского гуманитарного университета. Т. 1. Москва 2007, 124-130 Бугарски средњовековни владари Династија Крумовићи Христијанизација Бугарске Светитељи Бугарски светитељи
{ "redpajama_set_name": "RedPajamaWikipedia" }
3,859
Ectobius lineolatus es una especie de cucaracha del género Ectobius, familia Ectobiidae. Distribución Esta especie se encuentra en Sudáfrica, Mozambique, Suazilandia y Malaui. Referencias lineolatus Insectos de Sudáfrica Insectos de Mozambique Insectos de Malaui Insectos descritos en 1922
{ "redpajama_set_name": "RedPajamaWikipedia" }
2,388
\section{Introduction} There has recently been growing interest in employing machine learning to address certain challenges in communication systems, such as modulation classification \cite{8645696}, user association and resource allocation \cite{8796358}, power control for interference management \cite{8855869} and dynamic multichannel access \cite{8303773}. In particular, dynamic access is a typical long-term control problem that is generally modeled as a Markov decision process (MDP) or a partially observable Markov decision process (POMDP). In addressing these problems, several recent studies considered the application of deep reinforcement learning (DRL), taking advantage of its ability to explore, learn and adapt in unknown environments. For instance, the authors of \cite{8303773} proposed a deep Q-network (DQN) to learn the channel switching pattern and make channel selection decisions. In \cite{8665952} and \cite{8532121}, DQNs are used to allocate the spectral resources in time-division multiple access and orthogonal frequency-division multiple access networks, respectively, with the aims to effectively utilize these resources in a multi-user setting. Instead of only learning the patterns in the environment, DRL algorithms can also be used to account for the intrinsic temporal correlations among sequential decisions. Such a DQN framework is proposed in \cite{8302493} with the goal to utilize the spectral resources and reduce the co-channel interference in multibeam satellite systems. Moreover, DRL algorithms are also applied to jointly solve the multichannel access and task offloading in mobile edge computing as presented in \cite{9037194}. Aside from the frequently used DQN, recent research has also explored the application of other DRL algorithms in solving these types of dynamic control problems. For instance, authors in \cite{9037194} made use of the actor-critic framework, while a multi-agent deep stochastic policy gradient framework was proposed in \cite{kassab2020multi} for dynamic spectrum access problems. While significant strides have been made in solving the aforementioned problems, this increasing interest in applying machine learning algorithms to communication systems also brings forth potential security risks due to adversarial attacks. Since machine learning methods are highly data-driven algorithms, even a minor modification in the observation data can lead to dramatic changes in the learning-based decision policies \cite{goodfellow2014explaining}. Therefore, adversarial machine learning has been intensively studied to better understand the vulnerabilities of machine learning methods. In particular, in the literature, adversarial attacks have been considered and widely applied to deep learning-based classification problems, such as the classification of images \cite{dong2018boosting} \cite{dong2019evading} \cite{jia2019enhancing}, time series \cite{fawaz2019adversarial} and sound events \cite{subramanian2019adversarial}. In these cases, the victim models are trained and fixed, and the input data is accessible to the attacker, so that the attack can be realized by crafting adversarial examples to mislead the victim's decisions. This idea is also used in the attack on reinforcement learning-based tasks \cite{zhao2019blackbox} and \cite{huang2017adversarial}. However, in certain control problems, the observations of the reinforcement learning agents are not available to the attacker, making it infeasible to craft any adversarial examples. To tackle this difficulty, in \cite{gleave2019adversarial}, the authors trained a reinforcement learning-based adversarial policy instead. It is proved that adversarial jamming attack with either white-box or black-box setting may also lead to significant performance degradation \cite{yang2020enhanced}. Regarding adversarial attacks in wireless systems, a deep learning-based wireless jamming attack has been studied in \cite{shi2018spectrum} and \cite{erpek2018deep}, in both of which, the system consists of a single transmitter, a receiver, one background traffic source whose activity decides the channel state and a deep learning-based jammer. We finally note that in addition to adversarial attacks, there is a growing body of work introducing various defense strategies against adversarial attacks on deep learning schemes (e.g., using convolutional neural networks \cite{madry2017towards,zhang2019theoretically,xu2017feature} and deep reinforcement learning \cite{zhan2020preventing}). Adversarial jamming attacks also stimulate further investigation on corresponding mitigating strategies against such attacks \cite{sagduyu2020wireless}. Motivated by these considerations, we in this paper address a scenario in which a well-trained victim user performs DRL-based dynamic channel access \cite{8896945}. We first design a DRL based jamming attacker that employs a dynamic policy and aims at minimizing victim's channel access accuracy. Both the victim user and jamming attacker can learn effective strategies with feedback from each other over time. Therefore, in this setting, we address a dynamic control problem \cite{zhong2020adversarial}. Subsequently, we develop defense strategies for the victim user. In particular, we propose diversified defense with proportional-integral-derivative (PID) control, diversified defense with imitation attacker, and defense via orthogonal policies to mitigate the jamming attack and maximize victim's accuracy of accessing channels with favorable conditions \cite{wang2020defense}. To the best of our knowledge, we for the first time in this paper analyze the interactions between a DRL-based dynamic channel access agent and a DRL-based jamming attacker agent. Our key contributions can summarized as follows: \begin{itemize} \item We design a DRL attacker agent that can observes the environment partially (e.g., one channel at a time), learns the channel access patterns of the victim user, and performs jamming attacks. We also propose a novel stop-retrain-attack (SRA) procedure for the attacker to observe and attack the victim efficiently. \item We consider a practical setting in which both the victim and attacker start with black-box settings, where they have no knowledge of each other's model structure (except in the diversified imitation defense strategy) or parameters. We study their interactions with each other. After interacting, both retrain their models to adapt to each other over time. \item We propose diversified defense and orthogonal policies defense strategies to protect the victim from being learned by the attacker. We evaluate the performances of the defense strategies and demonstrate significant improvements in the victim user's accuracy in dynamic channel access. \end{itemize} The remainder of the paper is organized as follows. In Section \ref{Sec: pre}, we describe the DRL based multichannel access victim user model. In Section \ref{sec: RL}, we introduce the proposed DRL based jamming attacker, evaluate its performance and also address the impact of power budget limitations. In Sections \ref{sec: pid} through \ref{sec: 2policies}, we develop and analyze three different defense strategies: 1) diversified PID defense; 2) diversified imitation defense; 3) defense via orthogonal policies. Finally, we provide experiment results and address attack detection in Section \ref{sec: exp} and conclude in Section \ref{sec: con}. \section{Dynamic Channel Access Policies of the Victim User}\label{Sec: pre} In this section, we introduce the background on DRL based dynamic multichannel access. As noted above, we consider an actor-critic DRL agent proposed in \cite{8896945} as the victim user to be attacked. \subsection{Channel Switching Pattern}\label{subsec: channel} In the considered dynamic multichannel access problem, the time is slotted and the user selects one channel to access at the beginning of each time slot. We assume that the state of each channel switches between good and bad in a certain probabilistic pattern. When the channel is in good condition, the user can transmit data successfully. Otherwise, a transmission failure will occur. We also assume that the channel switching pattern can be modeled as a Markov chain, and in each state of which, there are $k$ out of the $N$ channels in good condition. At the beginning of each time slot, the channel pattern can either switch to the next state with probability of $\rho$, or remain to be the same as the state in the last time slot with probability of ($1-\rho$). In Fig. \ref{fig:channelpattern}, we display a round-robin switching pattern with two out of $16$ channels being good in each time slot and each channel has the same probability to be in good state. \begin{figure} \centering \includegraphics[width=1.1\linewidth]{ChannelPattern.eps} \caption{ Round-robin switching pattern when two of the 16 channels is in good condition and the switching probability is $\rho$ = 0.95. The channel in good state at a given time is indicated by white squares.} \label{fig:channelpattern} \end{figure} \subsection{Actor-Critic Agent}\label{subsec: victim} It is assumed that the channel switching pattern is unknown to the user, and the user can only observe the channel selected in the current time slot. Hence, the multichannel access is a partially observable Markov decision process (POMDP). To help the user to access the good channels as frequently as possible under such conditions, we proposed in \cite{8896945} an actor-critic deep reinforcement learning based agent to make the channel access decisions in each time slot. The proposed agent is designed to learn the channel switching pattern through past decisions and the corresponding feedback from the channels. We assume that, at time $t$, the channel state can be denoted as $\mathtt{X}_t = \{\mathtt{x}_1, \mathtt{x}_2, \ldots, \mathtt{x}_{N} \} $, where $N $ is the total number of channels, $\mathtt{x}_i$ stands for the state of the $i^{th}$ channel. For each channel $i$, where $i = 1, 2, \ldots, N$, we have $\mathtt{x}_i = 1$ if the channel is in good state, or $\mathtt{x}_i = 0$ if the channel is in bad state. And each time the agent senses a channel, the state of the sensed channel is revealed to be either good or bad. Therefore, we define the reward (feedback) as follows: if a good channel is chosen, the reward $r_t$ will be $+1$; otherwise, the reward $r_t$ will be $-1$. The agent's observation can be denoted as $O_t = \{o_1, o_2, \ldots, o_N \}$, where $N$ is the total number of channels. If channel $i$, $i = 1, 2, \ldots, N$, is chosen, the agent senses it and learns its state, so we define $o_i = r_t$; otherwise, the agent will record $o_i = 0$. The agent will learn on the basis of its previous experience. We assume that the agent keeps an observation space $\mathcal{O}$ that consists of the most recent $M$ observations. The observation space is initialized as an all-zero $N \times M$ matrix, and at each time $t$, the latest observation $O_t$ will be added to the observation space, and the oldest observation $O_{t-M}$ will be removed. The updated observation space $\mathcal{O}$ at time $t+1$ can be denoted as $\mathcal{O}_{t+1} = \{O_{t}; O_{t-1}; \ldots; O_{t-(M-1)} \}$. Next, we consider a discrete action space denoted by $\mathcal{A} = \{1, 2, \ldots, N \}$, where $N$ is the total number of channels. Each valid action in the action space describes the index of the channel that will be accessed. Hence, when an action is chosen, the agent will access the corresponding channel and receive the reward which reveals the condition of the chosen channel. The agent can only choose one channel to sense/learn in each iteration. The aim of the agent is to find a policy $\pi$, which maps the observation space $\mathcal{O}$ to the action space $\mathcal{A}$, that maximizes the long-term expected reward $R$ of channel access decisions: \begin{equation*} \pi^* = \arg \max_{\pi} R \end{equation*} where $\pi^*$ denotes the optimal decision policy, and in a finite time duration $T$, we express $R$ as \begin{equation*} R = \frac{1}{T} \sum_{t = 1}^{T} r_t. \end{equation*} And according to the definition of $R$, we have $R \in [-1, 1]$. \subsection{Performance in the Absence of Jamming Attacks} We consider the channel switching pattern shown in Fig. \ref{fig:channelpattern}, and evaluate the accuracy of the good channel access by the user with $N = M = 16$. The evaluation is performed in the absence of any jamming attacks and after the DRL agent is well trained. In Fig. \ref{fig:victimaccuracybeforeattack}, we test the model in two cases. First, we consider the $\epsilon$-greedy policy with $\epsilon = 0.1$, with which the user accesses a random channel with probability 0.1 (for exploration), and chooses the channel selected by the reinforcement learning policy with probability 0.9. We note that $\epsilon$-greedy policies with $\epsilon > 0$ are generally employed to enhance the DRL agent's ability to adapt to changes in the channel patterns, as will be discussed in detail in Section \ref{sec: exp}. In addition, we also consider the case in which $\epsilon$ is set to 0 to identify the performance of the pure DRL policy. We observe in the figure that high average accuracies (higher than $85\%$ and around $95\%$ with $\epsilon = 0.1$ and $\epsilon = 0$, respectively) are attained in the absence of jamming attacks. \begin{figure} \centering \includegraphics[width=0.9\linewidth]{victimAccuracy_beforeAttack.eps} \caption{Accuracy of the good channel access in the absence of jamming attacks.} \label{fig:victimaccuracybeforeattack} \end{figure} \section{DRL Based Jamming Attacker}\label{sec: RL} In this section, we introduce an actor-critic DRL agent to perform the jamming attack on the aforementioned victim user without having any prior information about the channel switching pattern or the victim's action policy. The DRL attacker is able to jam a single channel in each time slot to significantly reduce the selection accuracy of the actor-critic agent. We also assume that the DRL attacker is able to observe the victim's interaction with the environment for a period of time that is sufficiently long for the DRL attacker to learn the activity pattern. \subsection{Actor-Critic Model} \begin{figure} \centering \includegraphics[width=.8\linewidth]{RLattacker_Diagram_revised.pdf} \caption{Diagram of actor-critic structure and DRL attacker-environment interactions.} \label{fig:rlattackerdiagram} \end{figure} In Fig. \ref{fig:rlattackerdiagram}, we show the diagram of the actor-critic structure and the DRL attacker-environment interactions. The channels and victim's channel selection model form the environment to be observed by the attacker. At the beginning of each time slot, after the DRL attacker observes the environment, it can select one channel based on its own observation and action policy learned by the actor-critic neural networks. Here, it is noted that the DRL victim also dynamically selects channels at the beginning of each time slot based on the victim's observations and action policy. We assume that the attacker and victim select channels without knowing the decision made by each other in the current time slot. Then, the attacker's reward and the new state of the environment after executing the chosen action will be sent to its critic neural network to calculate the temporal difference (TD) error. This TD error will be used to update both critic and actor neural networks. When the update of network is completed, the DRL attacker model is ready to make the next decision. Above, we have summarized the operation of the attacker DRL agent. Next, we provide more detailed descriptions regarding the observations, actions, rewards of this attacker (or equivalently jamming) agent along with its actor-critic structure. \emph{Attacker Agent's Observations:} As mentioned before, the DRL attacker agent has no knowledge of the channel patterns and the victim user's policy. Hence, from the perspective of the DRL attacker agent, the channels and victim form an unknown environment. And therefore, the only accessible information that can be used as the states in the actor-critic neural networks is the attacker agent's observations. We assume that in each time slot $t$, the observation of the DRL attacker is denoted as $\mathit{\Phi}_t = \{\phi_{t,1}, \phi_{t,2}, \dots, \phi_{t,N} \}$. Then each element $\phi_{t,i}$, for $i = 1, 2, \dots, N$, stands for the observation in the $i^{\text{th}}$ channel at time $t$. As assumed before, the DRL attacker can only choose one channel at a time, so we have \begin{align} \phi_{t, i}=\begin{cases} r_t \hspace{.5cm} \text{if the $i^{\text{th}}$ channel is selected in time slot $t$,}\\ 0 \hspace{.5cm} \text{if the $i^{\text{th}}$ channel is not selected in time slot $t$.} \end{cases} \end{align} Above, $0$ indicates that no information is available on a channel that has not been selected. And in our implementation, it is assumed that the DRL attacker can keep a memory of the latest $T$ observations, so that the memory forms the observation space $\mathbf{\Phi}_{t} = \{\mathit{\Phi}_{t-1}, \mathit{\Phi}_{t-2}, \dots, \mathit{\Phi}_{t-T}\}$ and use it as the input of the DRL agent. \emph{Attacker Agent's Actions:} The action space of the attacker agent is formed by all valid actions that indicate which channel to jam to lead to victim's failure. Here, the attacker and victim share the same action space $\mathcal{A}$. \emph{Attacker Agent's Reward:} The reward is received when the action is executed, meaning that the attacker agent chooses a channel to jam and gets direct feedback from the environment. The action of the DRL attacker and the victim at time $t$ are denoted as $a_t^A$ and $a_t^V$ respectively. Since both the DRL attacker and the victim select one out of the $N$ channels, the sizes of their action spaces are the same. We assume that there are proper mechanisms and measurements (such as SINR levels, ACK signals) through which the attacker learns if the victim has selected the same channel as the attacker itself, i.e., $a_t^A = a_t^V$, and if the victim has transmitted successfully. The goal of the attacking DRL agent is to learn the victim's activity pattern so that it can jam the channels selected by the victim as much as possible. Based on this objective, we define the reward of the DRL attacker at time $t$ as \begin{align} r_t = \begin{cases} + 1 \hspace{.55cm} \text{if $a_t^A = a_t^V$ and victim selects a good channel,}\\ + 0.5 \hspace{.3cm} \text{if $a_t^A = a_t^V$ and victim selects a bad channel,}\\ - 0.5 \hspace{.3cm} \text{if $a_t^A \neq a_t^V$ and victim selects a bad channel,}\\ - 1 \hspace{.55cm} \text{if $a_t^A \neq a_t^V $ and victim selects a good channel.} \end{cases} \end{align} Within this setting, the DRL agent is encouraged to select the same good channels as the victim as its first priority. We also consider the case in which the attacker and victim select the same bad channel as partial success in terms of jamming. \subsubsection{Attacker Agent's Actor-Critic Structure} The actor-critic structure consists of two neural networks, namely the actor network and critic network. The parameters of these two neural networks are initialized and updated as follows: \emph{Actor:} The actor is employed to explore a policy $\pi$, that maps the agent's observation $\mathbf{\Phi}$ to the action space $\mathcal{A}$: \begin{equation} \pi_{\vartheta}(\mathbf{\Phi}) : \mathbf{\Phi} \rightarrow \mathcal{A}. \end{equation} Therefore, the mapping policy $\pi_{\vartheta}(\mathbf{\Phi})$ is a function of the observation $\mathbf{\Phi}$ and is parameterized by $\vartheta$. And the chosen action can be denoted as \begin{equation} a^{A} = \pi_{\vartheta}(\mathbf{\Phi}) \end{equation} where we have $a^{A} \in \mathcal{A}$. Since the action space is discrete, we use softmax function at the output layer of the actor network so that we can obtain the scores of each action. The scores sum up to $1$ and can be regarded as the probabilities to obtain a good reward by choosing the corresponding actions. \emph{Critic:} The critic is employed to estimate the value function $V(\mathbf{\Phi})$. At time instant $t$, when the action $a^{A}_t$ is chosen by the actor network, the agent will execute it in the environment and send the current observation $\mathbf{\Phi}_t$ along with the feedback from the environment to the critic. The feedback includes the reward $r_t$ and the updated observation $\mathbf{\Phi}_{t+1}$. Then, the critic calculates the TD error: \begin{equation} \label{eq:TDerror} \delta_{t} = r_t + \gamma V_{\mu}(\mathbf{\Phi}_{t+1}) - V_{\mu}(\mathbf{\Phi}_t) \end{equation} where $\gamma \in (0,1)$ is the discount factor. \emph{Update:} The critic is updated by minimizing the least squares temporal difference (LSTD): \begin{equation} V^* = \arg \min_{V_{\mu}} (\delta_{t} )^2 \end{equation} where $V^*$ denotes the optimal value function. The actor is updated by policy gradient. Here, we use the TD error to compute the policy gradient\footnote{In (\ref{eq:policygradient}), policy gradient is denoted by $\nabla_{\vartheta} J(\vartheta)$ where $J(\vartheta)$ stands for the policy objective function, which is generally formulated as the statistical average of the reward.}: \begin{equation}\label{eq:policygradient} \nabla_{\vartheta} J(\vartheta) = E_{\pi_{\vartheta} } [ \nabla_{\vartheta} \log \pi_\vartheta(\mathbf{\Phi}, a^{A}) \delta_{t} ] \end{equation} where $\pi_\vartheta(\mathbf{\Phi}, a^{A})$ denotes the score of action $a^{A}$ under the current policy. Then, the weighted difference of parameters in the actor at time $t$ can be denoted as $\Delta\vartheta_{t} = \alpha \nabla_{\vartheta_t} \log \pi_{\vartheta_t}(\mathbf{\Phi}_t, a^{A}_t) \delta_{t}$, where $\alpha \in (0,1)$ is the learning rate. And the actor network can be updated using the gradient decent method: \begin{equation} \vartheta_{t+1} = \vartheta_t + \alpha \nabla_{\vartheta_t} \log \pi_{\vartheta_t}(\mathbf{\Phi}_t, a^{A}_t) \delta_{t}. \end{equation} \subsection{Operational Modes} Once the DRL agent is initialized, it switches between two different modes: listening mode and attacking mode. \begin{itemize} \item \emph{Listening mode:} In this mode, the DRL agent only observes the environment and updates its own policy based on the reward, but does not jam the selected channels so that the victim is not influenced and does not adopt a new policy. \item \emph{Attacking phase:} In this mode, the DRL agent jams the selected channels and decides whether to update its neural networks based on the victim's performance. When the victim performs well, the DRL agent should evolve its policy as the victim gradually adapts to the attacker's influence. However, when the victim performs poorly, the DRL agent should stop learning from the reward. Because in this situation the victim may frequently choose channels in bad states, and the reward may misguide the attacker. \end{itemize} We assume that the victim's model is pre-trained so that the victim's activity pattern is stable when the attacker starts to train its own neural networks. In this training phase, the DRL attacking agent works in the listening mode. And when the DRL agent is well trained, it can start the dynamic attack which we describe in detail in the following subsection. \subsection{Dynamic Attack} The DRL attacker uses the stop-retrain-attack (SRA) procedure shown in Fig. \ref{fig:RAS}. DRL attacker aims at avoiding the situation in which the victim learns a totally new action policy once the model is well trained. For this purpose, the duration of each cycle of the DRL attacker is fixed at a certain value that prevents the victim to update to a new policy. \begin{figure} \centering \includegraphics[width=1.\linewidth]{retrieve-retrain-attack-stop.eps} \caption{Stop-retrain-attack procedure of dynamic attack: \textcircled{\raisebox{-0.9pt}{1}} initial attack \textcircled{\raisebox{-0.9pt}{2}} stop attack \textcircled{\raisebox{-0.9pt}{3}} start retraining \textcircled{\raisebox{-0.9pt}{4}} stop retraining and start attack \textcircled{\raisebox{-0.9pt}{5}} stop updating the model} \label{fig:RAS} \end{figure} As shown in Fig. \ref{fig:RAS}, the DRL attacker starts its first attack at time \textcircled{\raisebox{-0.9pt}{1}} when the victim model has been working in a stable fashion and working well. Before this point, the DRL attacker works in listening phase to learn the victim's activity pattern, and we assume that at time \textcircled{\raisebox{-0.9pt}{1}}, the DRL attacker can also function well with high stability. Once the attack is initiated, the performance of the victim drops rapidly. In this process, the victim keeps updating its model to overcome the influence of the attacks, and at the same time, the attacker also keeps updating its model to adapt to the victim's changing policy. However, we should note that the attacker is always encouraged to choose the same channel as the victim does. Hence, when the victim is forced to explore other channels which are not attacked in order to find a new policy to counteract against the attacks, it cannot avoid but try bad channels in order to find the good ones. From the perspective of DRL attacker, there is no need to follow the victim's selection because the victim's model updates dramatically and the policy may perform worse initially. On the one hand, it is difficult for the attacker to learn an unstable policy. On the other hand, copying the bad policy may give victim the chance to recover its performance. Based on this idea, the DRL attacker stops updating when the performance of the victim is lower than a threshold and we mark this time instant as time \textcircled{\raisebox{-0.9pt}{5}}. Though the DRL attacker model stops learning, it still works in attacking mode, so the performance of the victim continues to decrease. As mentioned before, the DRL attacker should stop jamming the channels before the victim adapts to its attacks, because the victim is also a reinforcement learning agent that has the ability to act against attacks naturally. At time \textcircled{\raisebox{-0.9pt}{2}}, the victim's performance starts to recover, meaning that a new policy is being formed in the victim model. To avoid pushing the victim to the new policy further, the DRL attacker needs to switch to the listening mode at time \textcircled{\raisebox{-0.9pt}{2}} to encourage the victim to return to its old policy as quickly as possible. And at time \textcircled{\raisebox{-0.9pt}{3}}, the victim is able to perform as well as that before the attack, and the DRL attacker will start to retrain its model and keep working in listening mode to adjust its policy based on the victim's activity until time \textcircled{\raisebox{-0.9pt}{4}} when the DRL attacker switches to attacking mode and starts a new cycle. In our implementation, the duration of each cycle is fixed to $2000$ time slots, and the gap between time \textcircled{\raisebox{-0.9pt}{3}} and \textcircled{\raisebox{-0.9pt}{4}} is fixed at $200$ time slots. Also, in the experiments, the duration between time \textcircled{\raisebox{-0.9pt}{2}} and \textcircled{\raisebox{-0.9pt}{3}} is very small. \subsection{Experiments}\label{subsec: RL exp} In this section, we test the proposed DRL attacker with a well-trained victim model and channel pattern introduced in Section \ref{Sec: pre}. First, we test the DRL attacker under the condition that victim model works with $\epsilon = 0$ to show its full power. In Fig. \ref{fig:rlattackerepsilonv}, we plot the victim's accuracy over time to show the attackers' performance. The victim's policy crashes immediately after the DRL attacker starts jamming the channels at time slot $t = 2000$. However, the victim's policy can recover only for a short period of time after a few thousands of time slots. These brief recoveries are due to the fact that, as a reinforcement learning-based agent, the DRL attacker operates with an $\epsilon$-greedy policy with $\epsilon = 0.1$. The randomness in the DRL attacker's policy leads to a small chance for the victim to recover its performance from time to time. \begin{figure} \centering \includegraphics[width=0.7\linewidth]{RLattacker_epsilonV.eps} \caption{Victim's accuracy under DRL attacker's SRA procedure. The victim does not employ an $\epsilon$-greedy policy (i.e., $\epsilon = 0$).} \label{fig:rlattackerepsilonv} \end{figure} We note that it is not challenging for the proposed to attacker to jam the channels selected by the victim most of the time, and considering this, we consider the more adaptive victim model with $\epsilon = 0.1$ in the following experiments to show the performance of the proposed attacker facing a stronger victim user. In Fig. \ref{fig:rlattackerrras}, we plot the accuracy of the stronger victim with $\epsilon = 0.1$ under DRL attacker's SRA procedure. The DRL attacker stops updating the policy when the victim's accuracy is lower than 30\% and switches to the listening mode when the victim's accuracy recovers to higher than 30\% or if the duration of the current cycle is longer that $2000$ time slots. In the listening mode, the DRL attacker reloads its initial policy and retrains for 200 time slots before the next attacking mode starts. In Fig. \ref{fig:rlattackerrras}, we observe that the DRL attacker is able to have the victim's performance drop substantially and the recovery occurs over a very short period of time but the performance drops again significantly, which means that the victim operates with very low accuracy most of the time. Hence, under the DRL attacker's SRA procedure, the victim's accuracy is effectively limited to a low level. We also note that the pattern in Fig. \ref{fig:rlattackerrras} is similar to the one predicted in Fig. \ref{fig:RAS}. \begin{figure} \centering \includegraphics[width=0.7\linewidth]{RLattacker_RRAS.eps} \caption{Victim's accuracy under DRL attacker's SRA procedure. The victim employs $\epsilon$-greedy policy with $\epsilon = 0.1$.} \label{fig:rlattackerrras} \end{figure} \begin{figure} \centering \includegraphics[width=0.7\linewidth]{RLattacker_pdf.eps} \vspace{-0.2cm} \caption{Empirical PDF of victim's accuracy under DRL attacker's SRA procedure.} \label{fig:rlattackerpdf} \end{figure} \begin{figure} \centering \includegraphics[width=0.7\linewidth]{RLattacker_cdf.eps} \vspace{-0.2cm} \caption{Empirical CDF of victim's accuracy under DRL attacker's SRA procedure.} \label{fig:rlattackercdf} \end{figure} Next, we plot the corresponding empirical probability density function (PDF) and empirical cumulative distribution function (CDF) of the moving average of victim's accuracy in Figs. \ref{fig:rlattackerpdf} and \ref{fig:rlattackercdf} based on the accuracy results. Note that, to obtain the empirical PDF and CDF, we start collecting the accuracy data following the initial attack phase at time $t = 2000$. In Fig. \ref{fig:rlattackerpdf}, we observe that the victim's accuracy is highly concentrated around the level of $0.1$, and the corresponding empirical CDF in Fig. \ref{fig:rlattackercdf} exceeds 80\% when the accuracy is around 0.2. These results further indicate that the victim's accuracy is very low in the presence of jamming attacks. Specifically, the victim achieves accuracy levels of 0.2 or less around 80\% of the time. \subsection{Impact of Limits on Attacker Power Budget}\label{subsec: budget exp} In the SRA process, DRL attacker is assumed to always perform jamming attacks during the attacking phase, and stop during the listening phase periodically. To control the jamming power consumption, we in this section consider a budget on how frequently the attacker can perform jamming during the attack stage. In each time slot, the actor of attacker's actor-critic DRL agent gives an array of probabilities that the attacker should attack each of the channels, and the attacker attacks the channel with the highest probability $p_{attack, max}(t)$. Due to the limited power budget, the attacker now only attacks when $p_{attack, max}(t)$ is higher than a threshold $p_\theta$, otherwise it pauses the attacks and listens. Within each period of $T$ time slots, if the attacker has already attacked more than $\lfloor T\theta \rfloor$ times, it ceases the attacks until the next period so that the average jamming power consumption is limited by $\theta$ fraction of the peak jamming power, where $0<\theta<1$. At the end of the current period, the attacker updates the threshold $p_\theta$ with the recorded probabilities $\{p_{attack, max}(t), \text{ for } t = t_0, t_0+1, \ldots, t_0+T-1\}$. We rearrange the $T$ probabilities in descending order, and pick the $\lfloor T\theta_u \rfloor$th lowest probability as the updated threshold $p_\theta$, where, for instance, we can set $\theta_u=\theta$. It is obvious that the actual ratio of attacked time slots is less than or equal to $\theta$, because the distribution of $p_{attack, max}(t)$ fluctuates over time, but $p_\theta$ is determined by the probabilities of the last period. If the probabilities in the current time period grow higher, the attacker tends to select more time slots to attack, and reach the threshold $\lfloor T\theta \rfloor$ before $t=t_0+T-1$, and then stop until the next period. In such a period, the attack ratio is $\theta$. On the contrary, if the probabilities drop lower, the attacker tends to choose less time slots to attack. Due to this, it will potentially not reach the threshold $\lfloor T\theta \rfloor$, and the attack ratio is less than $\theta$. Both scenarios occur in our simulations, and therefore the average attack ratio generally becomes less than $\theta$. Due to this, one may consider setting $\theta_u>\theta$, so that the first case (higher probabilities) is experienced more frequently and the second case less frequently. With this, the attack ratio increases. However, we have experienced that the victim accuracy also increases, which means we attack more frequently, but the attacker is weaker than the original setting $\theta_u=\theta$. It turns out that this modified attack policy tends to perform unnecessary attacks and the pattern is more predictable and hence less difficult to learn by the victim. Due to this, in the following experiments, we use $\theta_u=\theta$, and call this attack power budget parameter $\theta$ as the attack rate since this is also a measure of how frequently jamming attacks are performed within a given period. In Fig. \ref{fig:acc_att_rate}, we plot the victim's accuracy as a function of the attack rate $\theta$ with $T=1000$. Different values of $T$ lead to similar curves. In this figure, we notice the elbow point at $\theta = 0.3$. Increasing the attack rate beyond this limit will not lead to a significant drop in the victim's accuracy. Therefore, $\theta = 0.3$ is a relatively reasonable budget on the attack rate, at which victim's accuracy is still suppressed to $34.6\%$. Fig. \ref{fig:noise_length} shows the empirical distribution of different lengths of consecutive jamming attacks. All jamming attacks are less than 10 time slots long (indicating that we have consecutive jamming attacks over at most 10 time slots before the attacker agent stops), and the peak is experienced at 1, so the jamming attack emission is intermittent and steady. \begin{figure} \centering \includegraphics[width=0.7\linewidth]{Accuracy_vs_AttackRate_1000.eps} \caption{Victim's accuracy vs. attack ratio} \label{fig:acc_att_rate} \end{figure} \begin{figure} \centering \includegraphics[width=0.7\linewidth]{NoiseLength_1000_0_4.eps} \caption{Empirical distribution of the length of consecutive jamming attacks} \label{fig:noise_length} \end{figure} Above, we see that even the budgeted attack performs well in the absence of defensive strategies. In the following sections, we remove the budget constraint from the attacker agent and propose and test different defense strategies against the full power attacker, which represents the worst case scenario from the victim's perspective. \section{Diversified Defense with PID Control}\label{sec: pid} As shown in the last section, a jamming attack will lead to a significant drop in victim's accuracy. In the following three sections, we assume that the observed sudden decrease in accuracy is due to an attack, and we will address detection of attacks in subsection \ref{subsec: detection}. In this section, we introduce a diversified defense strategy that utilizes proportional-integral-derivative (PID) control based on recorded victim accuracy history, so that this strategy is universally applicable to any other type of adversarial jamming attacks. \subsection{Diversified Defense}\label{subsec: div} Aforementioned attacker agent can choose one channel at a time to perform the jamming attack, block victim's transmission and significantly interrupt its learning process. In the presence of such attacks, we have observed in Section \ref{sec: RL} that the victim without any defense will have significantly lower accuracy. As the attacker continuously learns from interactions with the environment and victim, traditional defense methods \cite{yuan2019adversarial} do not work against such an attacker. If the victim attempts to predict which channel will be attacked and chooses a less wanted one on purpose, it will fall into a dilemma: the less the victim user deviates from the DRL policy, the weaker defense we have; the more it deviates from the DRL policy, the more likely that the victim model will suffer due to frequent selection of channels in bad state. One alternative approach is to choose one channel from multiple options according to a certain probability distribution \cite{balcan2018diversified}. The actor of victim actor-critic DRL agent provides an array of predicted probabilities $p_{victim}$ of each channel being in good state. The original setting is to choose the channel with the highest $p_{victim}$, but now we rank them in descending order of $p_{victim}$, and assign a fixed array of probabilities that we choose for each channel. (In the original scheme, the second and third highest $p_{victim}$ vary several orders of magnitude over time, and highest probability can get close to 1, making the channel selection more predictable.) That is to say, for the channels $i = 1, 2, \ldots, N$ listed in the descending order of the original probabilities determined by the DRL agent (which may correspond to different channels at different times), we assign a fixed probability array $\{p(1), p(2), \ldots, p(N) \}$, where $\sum_{i = 1}^{N} p(i) = 1$ and $p(i)$ decreases as $i$ increases. Then the probability that the victim user chooses channel $i$ is \begin{equation}\label{equ: constdiv} P\{a_{victim}(t) = i\} = p(i). \end{equation} However, such a strategy fails to utilize the victim accuracy and has limited performance. To address this, we propose an additional PID control as discussed next. \subsection{PID Control}\label{subsec: pid} PID controller is a feedback control system \cite{aastrom2006advanced}. The error $e(t)$ is defined as the difference between the desired goal and measured position. PID controller calculates the weighted sum of proportional, integral, and derivative terms of $e(t)$ to adjust the control variable $u(t)$ as shown below: \begin{equation}\label{equ: pid_general} u(t)=K_p e(t)+K_i \int_{0}^{t}e(t')dt'+K_d \frac{de(t)}{dt} \end{equation} where $K_p$, $K_i$, $K_d$ are constant weights. This approach is widely used to optimize automatic control since it can effectively correct systematic discrepancies and dampen oscillations. However, if we simply use the strategy with probabilities selected as in (\ref{equ: constdiv}), the probability to choose a channel will not change, regardless of how high or low the channel access accuracy becomes. Typically, as discussed in Section \ref{sec: RL}, dynamic attacker stops attacking and learns from the recovered victim periodically. Thus, when the accuracy abnormally increases, we also desire to suppress it by increasing the probability of accessing channels that are potentially in bad states. We apply the idea of PID control, and calculate the short term average, long term average and long term difference of victim channel access accuracy. We add these modified PID components to the probability array to dampen accuracy oscillations. For channels $i = 1, 2, \ldots, N$ listed in the descending order of $p_{victim}$, and for given victim channel access accuracy $\alpha(t)$, and constant arrays $p(i)$, $K_p(i)$, $K_i(i)$, $K_d(i)$, we modify (\ref{equ: constdiv}) as follows: \begin{equation}\label{equ: pid3} P\{a_{victim}(t) = i\} = P\{i\}(t) = \frac{P'\{i\}(t)}{\sum_{i'=1}^{N}P'\{i'\}(t)} \end{equation} where \begin{equation}\label{equ: pid2} P'\{i\}(t)=\max\{P''\{i\}(t), 0\} \quad \text{and} \end{equation} \begin{equation}\label{equ: pid1} \begin{aligned} P''\{i\}(t)= & \ p(i)+K_p(i)\sum_{t'=t-10}^{t-1}\alpha(t')+K_i(i)\sum_{t'=t-200}^{t-1}\alpha(t') \\ & +K_d(i)\left(\sum_{t'=t-200}^{t-1}\alpha(t')-\sum_{t'=t-400}^{t-201}\alpha(t')\right). \end{aligned} \end{equation} We have $K_p(i)$, $K_i(i)$, $K_d(i)$ increase as $i$ increases. When the accuracy is low, this will boost the probability to choose channels predicted to be in good states and suppress the probability of choosing channels in potentially bad states, and vice versa. Thus, we improve the performance of the victim, while keeping the attacker confused at the same time. \section{Diversified Defense with an Imitation Attacker}\label{sec: dummy} In this section, we propose another diversified defense strategy which assumes that the attacker operates using an actor-critic DRL agent. As the victim has access to all the time series information with which the attacker trains its agent, it can train its own imitation actor-critic DRL attacker, which may have different neural network parameters and reward assignment from the true attacker. However, as both of them share the same goal to choose the victim's channel, the policy of the imitation attacker is expected to converge to that of the true attacker. This property of deep learning is called transfer-ability \cite{xie2019improving}. Simply switching to the channel with the second highest probability when the imitation attacker provides a prediction of possible channels to be jammed is not a very effective strategy, because the dynamic DRL attacker can still learn from this pattern. Thus, we introduce another diversified defense to confuse the attacker with help from the imitation attacker by modifying (\ref{equ: constdiv}). Given that $i$ is the channel index rearranged in descending order of the probabilities provided by the victim DRL actor (considering which the original victim user chooses the first one, i.e., the channel with index $i =1$) and given that the imitation attacker chooses channel $a_{imitation}$, the probability that victim chooses channel $i$ is given as \begin{align}\label{equ: dummy} P\{a_{victim}(t) = i\} = \begin{cases} \mathbf{1}(i = 1) \hspace{.3cm} \text{if $a_{imitation}(t) \neq 1$}\\ p(i) \hspace{.3cm} \text{if $a_{imitation}(t) = 1$}\\ \end{cases} \end{align} where $\{p(i)\}$ is a fixed set of probabilities (generally selected in a way to satisfy $p(1)<.5$ and $p(2)>p(3)>p(4)>\ldots>p(N)$) and $\mathbf{1}(\cdot)$ is the indicator function. Within this setting, when the true attacker has an accurate prediction, the victim gets the same information from its imitation attacker and assigns larger probabilities to channels that had originally lower probabilities assigned by the DRL channel access agent, and the attacker can barely learn from this diversified selection. When the attack model collapses and fails to attack, the victim simply relies on its prediction made by the DRL multichannel access agent, and is almost unaffected by the attack. \section{Defense via Orthogonal Policies}\label{sec: 2policies} In this section, we introduce a defense strategy with orthogonal policies based on transition matrices without having any assumptions on the attacker and environment. Given action space $\mathcal{A}$, if a policy chooses action $a_1$ at time $t$ and action $a_2$ at time $t+\tau$ and receives positive reward for both actions, we define this transition from $a_1$ to $a_2$ as a successful $\tau$th order transition. We collect all such transitions for orders $\tau=1,2,3,\ldots,T$ during a certain observation time period, and add up to a set of transition frequency matrices of size $N\times N$, where $N$ is the total number of actions, and the component at row $a_1$ and column $a_2$ in the matrix corresponding to the $\tau$th order transitions describes the number of $\tau$th order transitions from action $a_1$ to $a_2$. We then define the normalized correlation of two transition matrices $M_{\pi_1\tau}$, $M_{\pi_2\tau}$ of the same order $\tau$ from different policies $\pi_1$, $\pi_2$ as \begin{equation}\label{equ: correlation} R(\pi_1,\pi_2,\tau)=\frac{M_{\pi_1\tau}\circ M_{\pi_2\tau}} {\sum\limits_{a_1 \in \mathcal{A}}{\sum\limits_{a_2 \in \mathcal{A}}{M_{\pi_1\tau}[a_1,a_2]}} \times \sum\limits_{a_1 \in \mathcal{A}}{\sum\limits_{a_2 \in \mathcal{A}}{M_{\pi_2\tau}[a_1,a_2]}}} \end{equation} where $\circ$ denotes element-wise Hadamard product, and $M_{\pi\tau}[a_1,a_2]$ denotes the element at row $a_1$ and column $a_2$ in the matrix corresponding to the $\tau$th order transitions of policy $\pi$. We define orthogonal policies as policies that have negligible normalized correlation. Since the orthogonal policies almost share no common action transitions, they have the longest distance in the action transition space. Therefore, once the attacker adapts to one of the orthogonal policies, it is difficult for the attacker agent to adapt to other orthogonal policies. Taking advantage of this, we minimize the normalized correlation to train a set of orthogonal policies. As an effective defensive strategy, the victim agent can switch between these orthogonal policies when being attacked. \begin{figure} \centering \includegraphics[width=1\linewidth]{Orthogonal_training_process.pdf} \caption{Training process for constructing two orthogonal policies} \label{fig:orthotrain} \end{figure} To apply this idea in the multichannel access defense problem, we design an iterative training process to train two orthogonal policies as depicted in Fig. \ref{fig:orthotrain}. We start with two copies of the trained victim model (as described in Section \ref{Sec: pre}), namely policy 1 and policy 2, and train them to minimize the normalized correlation between policy 1 and 2 alternately, so that each policy gradually deviates from each other, and becomes orthogonal. In each period, for example, we train policy 1 with high exploration probability $\epsilon=0.9$ to force it to explore a random channel with designed probability distribution $P(t)$, and then set $\epsilon=0$ for a short duration in listening mode to observe this trained policy and record its transition matrices $M_{\pi_1\tau}, \tau=1,2,3,\ldots,T$. The probability distribution $P(t)$ is generated from policy 2 transition matrices $M_{\pi_2\tau}, \tau=1,2,3,\ldots,T$ observed in the last period. If policy 1 leads to the choice of channel $a(\tau)$ at time $t-\tau$, we extract the probability array as \begin{equation}\label{equ: orthoprobp} p(\tau)=\text{normalize}\left(\frac{1}{M_{\pi_2\tau}[a(\tau),:]+1}\right) \end{equation} where $M_{\pi_2\tau}[a(\tau),:]$ is the $a(\tau)$th row of $\tau$th order transition matrix for policy 2, and the normalization is introduced so that the probabilities are non-negative and sum up to one (as in (\ref{equ: pid3}) and (\ref{equ: pid2})). Therefore, we have the following weighted sum of such probability distributions over different $\tau$s: \begin{equation}\label{equ: orthoprobP} P(t)=\text{normalize}\left({\sum_{\tau=1}^{T}{\varrho^{\tau-1}\eta_\tau \left(p(\tau)-\frac{1}{N}\right)}+\frac{1}{N}}\right) \end{equation} where $N$ is the total number of channels, $0<\varrho<1$ is decay factor, and $\eta_{\tau}$ is the indicator whether agent received positive reward at time $t-\tau$: \begin{align}\label{equ: theta} \eta_\tau = \begin{cases} +1.5 \hspace{.3cm} \text{if $r(t-\tau)=1$}\\ -0.5 \hspace{.3cm} \text{if $r(t-\tau)=-1$}.\\ \end{cases} \end{align} This distribution guarantees transitions that often appear in policy 2 are less explored by policy 1, which leads to orthogonality. Among these intensively explored transitions, DRL agent will only learn these successful actions, so the trained policies will be intermediate between $p(\tau)$ and the underlying environment, and maintain an acceptable accuracy. We should be aware of one potential risk of this training strategy, that two policies might tend to choose two non-overlapping subset of channels. Such pair of policies has low normalized correlation, but the mixed transition pattern is easy to learn by the attacker, i.e., an averaged transition map works perfect as an attack whichever policy is picked. Therefore, we introduce a regularization term to (\ref{equ: orthoprobP}). When we train one policy, for example policy 1, we also record how many successful actions were performed during the last policy 2 observation period in a 1-dimensional array $p_{reg}$. With this, we have the regularized distribution \begin{equation}\label{equ: orthoprobPreg} P(t)=\text{normalize}\left({\sum_{\tau=1}^{T}{\varrho^{\tau-1}\eta_\tau \left(p(\tau)-\frac{1}{N}\right)}+\frac{1}{N}+\beta p_{reg}}\right) \end{equation} where $0<\beta<1$ is a weight factor. We intend, but not force, to lead the two policies to choose the same subset of channels, so that the mixed transition pattern is much harder to learn by the attacker. An additional benefit is that we can use a higher learning rate to train the policies. An actor-critic agent might collapse by choosing one channel forever without exploring other channels when the learning rate is too high, but the regularization term leads it to explore a chosen subset of channels by the other policy, and avoid such a collapse. Therefore, we are able to use higher learning rates to train faster. \section{Experiments with Defensive Strategies}\label{sec: exp} In this section, we test the proposed defense strategies against the well-trained dynamic attacker described in section \ref{sec: RL}. Before the experiments start, the victim is trained over 500000 time slots and the attacker has another 200000 time slots until convergence. The trained victim starts at $t=0$, and the trained attacker initiates attacking at $t=2000$. As victim accuracy drops dramatically, defense agents start at $t=2400$. In all diversified defense cases, we set $\epsilon=0$ (the probability to choose a channel randomly) at the victim DRL agent, as we have already deployed better randomized strategies. \subsection{Diversified PID Defense}\label{subsec: pid exp} First, we test the diversified PID defense described in Section \ref{sec: pid}. We plot the moving average of the victim's accuracy in Fig. \ref{fig: pid}. During the initial 2000 time slots, the victim without the attacker performs well, but when the attack starts, the accuracy drops below $20\%$. As observed in Fig. \ref{fig:rlattackerrras}, the victim without any defense will have an average accuracy of $14\%$. Shortly afterwards, PID defense is initiated and the attacker model gradually collapses, so the victim accuracy rises to $39\%$, which is close to a half of the victim's performance in the absence of a jamming attacker. In this experiment, the underlying channel pattern has 2 out of 16 channels in good condition, and the attacker knows if the chosen channel is good and if the victim also chooses it after the attack. Thus, this result means that although the attacker learns from the victim's choice, we have managed to confuse the attacker to some extent. \begin{figure} \centering \includegraphics[width=0.7\linewidth]{PID_curve} \caption{Victim's accuracy with diversified defense involving PID control.} \label{fig: pid} \end{figure} Figs. \ref{fig: pid_pdf} and \ref{fig: pid_cdf} show the corresponding empirical PDF and CDF of PID converged performance. Note that we have made an additional assumption only for the PID case that after being attacked, the victim knows if the chosen channel was good before attack. In this case, we set the victim reward as 0.5 (to indicate a partially good choice) instead of -1, encouraging the victim to try the underlying good channels. As PID assigns more randomness to channel selection, it is necessary to lead the victim towards good channels even if they have been attacked, to avert victim model from collapsing. The converged accuracy without such an assumption is about $30\%$. \begin{figure} \centering \includegraphics[width=0.7\linewidth]{PID_PDF} \caption{Empirical PDF of victim's accuracy under diversified PID defense.} \label{fig: pid_pdf} \end{figure} \begin{figure} \centering \includegraphics[width=0.7\linewidth]{PID_CDF} \caption{Empirical CDF of victim's accuracy under diversified PID defense.} \label{fig: pid_cdf} \end{figure} \subsection{Diversified Imitation Defense}\label{subsec: dummy exp} Next we test the diversified imitation defense described in Section \ref{sec: dummy}. We start to train the imitation attacker before the attack starts as well as the true attacker, but the reward setting is different. Given that the attacker chooses channel $a_{attacker}$, the victim chooses channel $a_{victim}$, and the underlying good channels are denoted by $G=\{i_1, i_2\}$, the reward of true attacker $r_T(t)$ is \begin{align} \label{equ: att rew} r_T(t) = \begin{cases} + 1 \hspace{.55cm} \text{if $a_{attacker} = a_{victim}$ and $a_{victim}\in G$,}\\ + 0.5 \hspace{.3cm} \text{if $a_{attacker} = a_{victim}$ and $a_{victim}\notin G$,}\\ - 0.5 \hspace{.3cm} \text{if $a_{attacker} \neq a_{victim}$ and $a_{victim}\notin G$,}\\ - 1 \hspace{.55cm} \text{if $a_{attacker} \neq a_{victim}$ and $a_{victim}\in G$.} \end{cases} \end{align} For the imitation attacker, we do not assume that the victim knows if an attacked channel was good or not, and therefore the imitation attacker only uses the criterion if it chooses the same channel as the victim does after the victim deploys diversified defense and switches to another channel. Thus, given the victim's channel selection $a_{victim}$ after the defense strategy is deployed, and the imitation selection $a_{imitation}$, the reward of the imitation attacker $r_I(t)$ is \begin{align} r_I(t) = \begin{cases} + 1 \hspace{.3cm} \text{if $a_{imitation} = a_{victim}$,}\\ - 1 \hspace{.3cm} \text{if $a_{imitation} \neq a_{victim}$.}\\ \end{cases} \end{align} We plot the moving average of the victim's accuracy in Fig. \ref{fig: dummy}. Initially, we have a similar performance as in the PID case, and after the diversified defense is initiated, the performance gradually converges to $90\%$ accuracy, indicating an outstanding defense against jamming attacks. Comparing with the performance without the attacker (shown in Fig. \ref{fig:victimaccuracybeforeattack}), the achieved accuracy is lower than the case of $\epsilon = 0$, where $95\%$ accuracy is attained, but higher than $85\%$ accuracy that is achieved with the $\epsilon$-greedy policy. \begin{figure} \centering \includegraphics[width=0.7\linewidth]{Dummy_curve} \caption{Victim's accuracy with diversified defense involving an imitation attacker.} \label{fig: dummy} \end{figure} We also observe the significantly improved performance in accuracy in Figs. \ref{fig: dummy_pdf} and \ref{fig: dummy_cdf} where empirical PDF and CDF are provided, respectively. We additionally note that the number of layers and nodes in the imitation attacker's neural network does not affect the performance, as long as the imitation attacker has the purpose to select the same channel as the victim does. The reward assignment of the imitation attacker can also vary. For instance, if we set it the same as the true attacker as in (\ref{equ: att rew}) or simply use $[a_{victim}\in G]$, the difference in the final accuracy is less than $2\%$. With all different settings, imitation attacker converges to the true attacker, with $82\%$ probability on average in choosing the same channel. So, this defense strategy is robust against different settings, and successfully misleads the actor-critic dynamic attacker, rendering it a very effective strategy against such attacks. \begin{figure} \centering \includegraphics[width=0.7\linewidth]{Dummy_PDF} \caption{Empirical PDF of victim's accuracy under diversified imitation defense.} \label{fig: dummy_pdf} \end{figure} \begin{figure} \centering \includegraphics[width=0.7\linewidth]{Dummy_CDF} \caption{Empirical CDF of victim's accuracy under diversified imitation defense.} \label{fig: dummy_cdf} \end{figure} \subsection{Defense via Orthogonal Policies}\label{subsec: 2policy exp} As another defensive mechanism, we introduce two orthogonal polices as discussed in Section \ref{sec: 2policies}. Note that these two policies are obtained via the victim neural networks. We retrain two copies of the victim's neural networks to minimize the normalized correlation of their transition matrices. In Fig. \ref{fig: transmat}, we show the first three pairs of transition matrices for two trained policies where $\epsilon=0$ (the probability to choose a random channel). We can see that policy 1 tends to select the channels that have adjacent indices, while policy 2 skips adjacent channels most of the time. In the absence of attacks, policy 1 has an accuracy of $80.5\%$ and policy 2 has an accuracy of $71.5\%$. (Note that we should only use initial victim model when there is no attack). \begin{figure} \centering \includegraphics[width=1\linewidth]{transition_matrices} \caption{First row: the transition matrices for policy 1 with $\tau=1,2,3$. Second row: the transition matrices for policy 2 with $\tau=1,2,3$.} \label{fig: transmat} \end{figure} In the defense phase, we reload these two policies iteratively to confuse the attacker, so that the attacker learns from one policy to the other all the time, and fails to perform a perfect attack. For every $2000$ time slots, we check if victim accuracy is lower than a certain threshold (e.g., $40\%$), and reload the other model if current policy fails. In Fig. \ref{fig:orthogonalacc}, we plot the victim accuracy when orthogonal policies are deployed as a defense strategy. The average accuracy increases from $14\%$ (before defense, as shown in Fig. \ref{fig:rlattackerrras}) to about $52\%$. Since the policy learned by the attacker is not orthogonal to the two designed orthogonal policies, it can be more similar to one of the two orthogonal policies (which is policy 1) than to the other policy (which is policy 2). However, since the two policies shown in Fig. \ref{fig: transmat} only share a few action transitions, the attacker's neural network cannot resume its high performance in a short period of time. With our strategy to switch policies as victim accuracy decreases, the overall performance almost remains the same over time. Figs. \ref{fig:orthogonalpdf} and \ref{fig:orthogonalcdf} show the corresponding empirical PDF and CDF of the accuracy. \begin{figure} \centering \includegraphics[width=0.7\linewidth]{Ortho_Interact_RL} \caption{Victim's accuracy with defense via orthogonal policies.} \label{fig:orthogonalacc} \end{figure} \begin{figure} \centering \includegraphics[width=0.7\linewidth]{Ortho_Interact_RL_PDF} \caption{Empirical PDF of victim's accuracy under defense with orthogonal policies.} \label{fig:orthogonalpdf} \end{figure} \begin{figure} \centering \includegraphics[width=0.7\linewidth]{Ortho_Interact_RL_CDF} \caption{Empirical CDF of victim's accuracy under defense with orthogonal policies.} \label{fig:orthogonalcdf} \end{figure} \subsection{Attack Detection}\label{subsec: detection} In the above evaluation of defense strategies, we have assumed that a sudden drop in victim's accuracy is always due to an adversarial attack. However, when the statistical description of the environment changes, the performance will also diminish. Since it will take a long time to retrain the user's DRL model, it is critical to distinguish environmental change from an adversarial jamming attack. Therefore, we propose an attack detection strategy based on orthogonal policies defense and diversified imitation defense. We define the new environment as another round-robin switching pattern, where the order of 16 channel list is shuffled, and switch to this pattern occurs at $t=2000$. Figs. \ref{fig:env_change_ortho} and \ref{fig:env_change_dummy} show how the accuracies of the users employing the orthogonal policies and imitation attacker strategy, respectively, vary when the environment changes. On the one hand, for the user with imitation defense, the performance after an environmental change (as depicted in Fig. \ref{fig:env_change_dummy}) is not significantly different from that under a jamming attack (see e.g., Fig. \ref{fig: dummy}) as both converge towards $90\%$ accuracy. Therefore, imitation defense strategy does not work as a detector of attacks although it performs well at last. Additionally, in the case of an environment change, the accuracy recovers with more fluctuations and more slowly than the DRL agent without defense strategies because of the disturbance from the imitation attacker. On the other hand, for the user employing orthogonal policies, the accuracy almost goes to zero immediately when the environment changes (Fig. \ref{fig:env_change_ortho}), which strongly contrasts to Fig. \ref{fig:orthogonalacc}, where the accuracy under jamming attack fluctuates around $55\%$ as soon as the attack starts, with a minimum above $20\%$. Thus, we propose to use orthogonal policies as an attack detection mechanism as follows. When the accuracy drops, we can first apply the defense with orthogonal policies. If the accuracy recovers and fluctuates with this approach, we confirm that it is an adversarial jamming attack, and switch to diversified imitation defense for better protection. The performance in this scenario is provided in Fig. \ref{fig:detector}. If, on the other hand, the accuracy does not recover even after orthogonal policies, we decide that the environment has changed and we retrain the DRL agent without initiating defense. \begin{figure} \centering \includegraphics[width=0.7\linewidth]{environment_orthogonal.eps} \caption{User's accuracy with orthogonal policies defense when environment changes} \label{fig:env_change_ortho} \end{figure} \begin{figure} \centering \includegraphics[width=0.7\linewidth]{environment_dummy.eps} \caption{User's accuracy with diversified imitation defense when environment changes} \label{fig:env_change_dummy} \end{figure} \begin{figure} \centering \includegraphics[width=0.7\linewidth]{Interact_detector.eps} \caption{Victim's accuracy under attack with orthogonal policies defense as detector at $t=2000$, confirm the attack, and switch to diversified imitation defense at $t=10000$} \label{fig:detector} \end{figure} \section{Conclusion}\label{sec: con} In this paper, we have introduced a dynamic actor-critic DRL jamming attacker aimed at minimizing the accuracy of a victim user performing dynamic multichannel access using its own DRL agent. We have introduced the actor-critic architecture of the proposed DRL attacker, and then presented its SRA working procedure. We have demonstrated that the DRL attacker can perform effectively in the absence of defense. In the performance evaluation of the DRL attacker, we have also considered a jamming power budget, limiting the attack rate. We have observed that with only $30\%$ power consumption (or equivalently attack rate), we can still suppress victim's accuracy to $34.6\%$. In these analyses, we have specifically conducted experiments with a stronger victim that applies the $\epsilon$-greedy policy. We also introduced three different diversified defense strategies, namely PID control, imitation attacker and orthogonal policies, against this attacker to improve the accuracy of the victim DRL agent. We have investigated how to set the probabilities in choosing different channels to confuse the attacker. We note that the diversified PID defense neither makes any assumption on the attacker nor acquires extra training beforehand and in this setting leads the victim user to reach an accuracy level of $39\%$. The diversified defense based on the immitation attacker assumes that the attacker employs an actor-critic DRL agent, and can attain a very high accuracy ($\approx90\%$) and is robust to different settings. As to the defense via orthogonal policies, we need to train the policies before the attack with no assumptions, and we achieve an accuracy of $50\%$. Based on orthogonal policies, we have also introduced an attack detection strategy that can differentiate attacks from changes in the environment. \bibliographystyle{IEEEtran}
{ "redpajama_set_name": "RedPajamaArXiv" }
1,618
\section{Introduction} Perovskite-related titanates are intensively studied both experimentally and theoretically, since they show interesting physical properties due to the complex interplay of structural and electronic degrees of freedom. Recently, special attention was paid to the compounds $R$TiO$_{3.0}$ (with $R$ being a trivalent rare-earth ion), \cite{Mochizuki04a} which are Mott-Hubbard insulators with a Ti 3d$^1$ configuration. LaTiO$_{3.0}$, in particular, has attracted much attention [\onlinecite{Mochizuki04a,Khaliullin00,Keimer00,Cwik03,Mochizuki03,Hemberger03,Kiyama03,Pavarini04,Haverkort05,Ruckkamp05,Ulrich05}], partly because of different orbital ordering scenarios. LaTiO$_{3.0}$ is the end member of the series LaTiO$_{3.5-x}$ with 0$\leq$$x$$\leq$0.5, in which one finds a rich variety of different structural, magnetic, and electronic properties, depending on the composition parameter $x$. Besides the Mott-Hubbard system LaTiO$_{3.0}$, the band insulator LaTiO$_{3.5}$ is a prominent member of the series because of its ferroelectricity up to extremely high temperatures.\cite{Nanamatsu74} \begin{figure}[t] \includegraphics[width=0.9\columnwidth]{struct.eps} \caption{(Color online) Crystal structure of LaTiO$_{3.41}$ composed of perovskite-like slabs of vertex-sharing TiO$_6$ octahedra, which are separated by additional oxygen layers.\cite{Daniels03} Along the $a$ axis the TiO$_6$ octahedra are connected via their apical oxygen atoms forming chains.} \label{structure} \end{figure} Other compounds of the series LaTiO$_{3.5-x}$ were synthesized recently,\cite{Lichtenberg01} among them LaTiO$_{3.41}$, which is a quasi-one-dimensional (quasi-1D) conductor according to its anisotropic DC resistivity and infrared response.\cite{Lichtenberg01,Kuntscher03} It crystalizes in a monoclinic structure (space group P2$_1$/c) with lattice parameters $a$=7.86 \AA, $b$=5.53 \AA, $c$=31.48 \AA, and $\beta$=97.1$^{\circ}$. \cite{Daniels03} The structure consists of slabs of vertex-sharing TiO$_6$ octahedra separated by additional oxygen layers (see Fig.\ \ref{structure}). Along $c$ the slabs are five octahedra wide, and neighboring slabs are shifted along the $a$ axis by half an octahedron. The octahedra are tilted away from the $a$ axis and rotated around this axis, similarly to the GdFeO$_3$-type arrangement of octahedra in LaTiO$_{3.0}$.\cite{Cwik03} LaTiO$_{3.41}$ can thus be viewed as being built of LaTiO$_{3.0}$-type slabs. The characteristic units of the crystal structure are chains of TiO$_6$ octahedra, connected via their apical oxygen atoms and oriented along the $a$ axis. These chains can serve as an explanation for the anisotropic electronic transport properties of LaTiO$_{3.41}$, with relatively low resistivity values along the chain direction $a$.\cite{Lichtenberg01} To shed light on the conduction mechanism of quasi-1D conducting LaTiO$_{3.41}$ its polarization-dependent reflectivity was studied as a function of temperature.\cite{Kuntscher03} An anisotropic optical response was observed, with a Drude contribution of free carriers for the polarization of the incident radiation parallel to the conducting crystal axis $a$ and an insulating character for the perpendicular direction $b$. Furthermore, the {\bf E}$\parallel$$a$ optical conductivity spectrum includes a pronounced mid-infrared (MIR) absorption band, showing a shift to lower frequencies and an increase in oscillator strength with decreasing temperature. A polaronic model was proposed to account for the temperature dependence of the MIR band.\cite{Kuntscher03} The application of external pressure to LaTiO$_{3.41}$ up to $P$=18~GPa leads to continuous changes of the crystal structure:\cite{Loa04} The axial compressibilities are anisotropic with a ratio of approximately 1:2:3 for the $a$, $b$, and $c$ axes. The large compressibility along $c$ results from the highly compressible oxygen-rich layers separating the LaTiO$_{3.0}$-type slabs (see Fig.\ \ref{structure}). The differences in axis compressibilities cause a small increase of the monoclinic angle from 97.17$^\circ$ to 97.43$^\circ$ with increasing pressure up to 18~GPa. From the pressure dependence of the lattice parameters the octahedral tilt angle against the $a$ axis was estimated to double at 18~GPa compared to ambient conditions. Above 18~GPa the appearance of additional reflections in the x-ray diffraction diagrams indicate a sluggish structural phase transition, which is completed at 24 GPa.\cite{Loa04} In this paper we report the effect of pressure on the MIR reflectivity of LaTiO$_{3.41}$. Reflectivity spectra of a single-crystal sample were measured for polarizations along the $a$ and $b$ axes using MIR micro-spectroscopy in combination with a diamond anvil high pressure cell. The primary motivation is twofold: (1) Pressure effects are of considerable interest for the interpretation of the MIR band polarized along the conducting crystal direction. (2) In view of the anisotropic compressibility, external pressure is a means to continuously tune the electronic anisotropy in the $ab$ plane and to explore the possibility of a crossover from one- to two-dimensional behavior. A further question is whether the pronounced optical anisotropy of the ambient-pressure phase is preserved across the first-order structural phase transition near 18~GPa. \begin{figure}[t] \includegraphics[width=0.85\columnwidth]{Ref_fit.eps} \caption{(Color online) (a) Room-temperature reflectivity spectra $R_{s-d}$ of LaTiO$_{3.41}$ inside the diamond anvil cell at $P=0.3$~GPa for the polarizations \textbf{E}$\parallel$\emph{a} and \textbf{E}$\parallel$\emph{b}. The light grey lines are fits of the reflectivity spectra with the Drude-Lorentz model, taking into account the sample-diamond interface. Inset: Enlargement of the low-frequency range of the \textbf{E}$\parallel$\emph{b} reflectivity spectrum showing the optical phonon mode at 800 cm$^{-1}$. (b) Optical conductivity spectra obtained from the Drude-Lorentz fits of the reflectivity data shown in (a). Inset: Geometries for the sample and reference measurements.} \label{Ref-fit} \end{figure} \begin{figure}[t] \includegraphics[width=0.85\columnwidth]{Rsd.eps} \caption{(Color online) Room-temperature reflectivity spectra R$_{s-d}$ of LaTiO$_{3.41}$ as a function of pressure for the polari\-zation (a) \textbf{E}$\parallel$\emph{a} and (b) \textbf{E}$\parallel$\emph{b}. The inset in (b) shows the low-frequency range (700 - 1000~cm$^{-1}$) of the spectra for four pressures. The phonon at around 800~cm$^{-1}$ shifts to higher frequencies with increasing pressure. The arrows indicate the changes with increasing pressure.} \label{R_s-d} \end{figure} \section{Experiment} \label{sectionexperiment} The investigated LaTiO$_{3.41}$ crystals were grown by a floating zone melting process, and their oxygen content was determined by thermogravimetric analysis.\cite{Lichtenberg01} Pressure-dependent reflectance measurements for the electrical field vector \textbf{E} of the incident light along the \emph{a} and \emph{b} axes were performed in the MIR frequency range (600-8000~cm$^{-1}$) at room temperature, using a Bruker IFs 66v/S Fourier transform infrared spectrometer. The measurements were carried out partly at the University of Stuttgart and partly at the infrared beamline of the synchrotron radiation source ANKA in Karlsruhe. A diamond anvil cell equipped with type IIA diamonds suitable for infrared measurements was used to generate pressures up to 20~GPa. To focus the infrared beam onto the small sample in the pressure cell, a Bruker IR Scope II infrared microscope with a 15x magnification objective was used. A field stop of 0.6 mm diameter was chosen, which yields a geometrical spot size of 40 $\mu$m on the sample (diffraction effects neglected). The LaTiO$_{3.41}$ crystal was polished to a thickness of $\approx$40 $\mu$m. The reflectivity of the free-standing polished sample was checked and found to be in good agreement with earlier results.\cite{Kuntscher03} A small piece of sample (about 80 \nolinebreak $\mu$m x 80 \nolinebreak $\mu$m) was cut and placed in the hole (150 $\mu$m diameter) of a steel gasket. Finely ground KCl powder was added as a quasi-hydrostatic pressure-transmitting medium. The ruby luminescence method \cite{Mao86} was used for the pressure determination. Polarized reflectivity spectra were measured at the interface between sample and diamond. The measurement geometry is shown in the inset of Fig.\ \ref{Ref-fit} (b). Spectra taken at the inner diamond-air interface of the empty cell served as the reference for normalization of the sample spectra. The absolute reflectivity at the sample-diamond interface, denoted as $R_{s-d}$, was calculated according to $R_{s-d}(\omega)=R_{\rm dia}\times I_{s}(\omega)/I_{d}(\omega)$, where $I_s(\omega)$ denotes the intensity spectrum reflected from the sample-diamond interface and $I_d(\omega)$ the reference spectrum of the diamond-air interface. $R_{\rm dia}$ was calculated from the refractive index of diamond $n_{\rm dia}$ to 0.167 and assumed to be independent of pressure. This is justified because $n_{\rm dia}$ is known to change only very little with pressure ($\Delta$$n_{\rm dia}$/$\Delta$P = -0.00075/GPa).\cite{Eremets92,Ruoff94} Variations in synchrotron source intensity were taken into account by applying additional normalization procedures. Strain-induced depolarization in the diamond anvil is considered negligible in the pressure range covered in the present experiment. \begin{figure}[t] \includegraphics[width=0.75\columnwidth]{Phonon_b.eps} \caption{Peak position of the phonon mode measured for \textbf{E}$\parallel$\emph{b}. Different symbols are used for different experimental runs. Up to 14~GPa the mode hardens in a linear fashion, with a linear pressure coefficient of 3.2 cm$^{-1}$/GPa. The line is a linear fit of the data points. At around 15~GPa an abrupt change in the frequency of the vibrational feature occurs.} \label{Phonon_b} \end{figure} \begin{figure}[t] \includegraphics[width=0.85\columnwidth]{sigma.eps} \caption{(Color online) Pressure-dependent real part of the optical conductivity of LaTiO$_{3.41}$ for (a) \textbf{E}$\parallel$\emph{a} and (b) \textbf{E}$\parallel$\emph{b} at room temperature, obtained by Drude-Lorentz fitting of the reflectivity data. The arrows indicate the changes with increasing pressure. The dotted vertical lines in (b) indicate the frequency positions analyzed in Fig.\ \ref{changes}.} \label{sigma1} \end{figure} \section{Results} \label{sectionresults} The reflectivity spectra of LaTiO$_{3.41}$ for the lowest pressure (0.3~GPa) are shown in Fig.\ \ref{Ref-fit}(a) for \textbf{E}$\parallel$\emph{a,b}. The region around 2000~cm$^{-1}$ is cut out from the experimental spectra since the diamond multi-phonon absorption causes artifacts in this range. The overall reflectivity of the sample in the diamond anvil cell is lower than that of the free-standing sample \cite{Kuntscher03} due to the smaller refractive index step at the sample-diamond interface. The optical conductivity was obtained by fitting the reflectivity spectra with a Drude-Lorentz model combined with the normal-incidence Fresnel equation \begin{equation} R_{s-d} =\left| \frac{n_{\rm dia}-\sqrt{\epsilon_s}}{n_{\rm dia}+\sqrt{\epsilon_s}}\right|^2 , \epsilon_s = \epsilon_\infty + \frac{i \sigma}{\epsilon_0 \omega} \quad , \end{equation} where $\epsilon_s$ is the complex dielectric function of the sample. With the 15x objective used in the experiment, the angle of incidence of the radiation at the diamond-sample interface ranges from 4.1$^{\circ}$ to 9.5$^{\circ}$; the average deviation from normal incidence is thus small enough to assume normal incidence for the data analysis. Furthermore, an increase of the background dielectric constant (by 14.5\% at maximum) according to the Clausius-Mossotti relation \cite{Ashcroft76} was assumed in the Drude-Lorentz fits to account for the pressure-induced reduction of the unit cell volume.\cite{Loa04} As an example, we present in Fig.\ \ref{Ref-fit}(a) the Drude-Lorentz fits of the reflectivity spectra for the lowest applied pressure (0.3~GPa); the resulting real part $\sigma_1$ of the optical conductivity is shown in Fig.\ \ref{Ref-fit}(b) for both studied polarizations. For fitting the lowest-pressure data, the fitting parameters for the reflectivity spectra of the free-standing sample were used as starting parameters. The resulting optical conductivity spectra at 0.3~GPa [Fig.\ \ref{Ref-fit}(b)] are in overall agreement with the ambient-pressure results.\cite{Kuntscher03} For the polarization of the radiation parallel to the conducting axis $a$ the optical conductivity spectrum consists of a pronounced, asymmetric absorption band, located at around 2500 cm$^{-1}$ at 0.3~GPa. For the perpendicular polarization direction, {\bf E}$\parallel$$b$, a phonon mode located at 800 cm$^{-1}$ and a broad band centered around 7000 \nolinebreak cm$^{-1}$ are observed for the lowest applied pressure. The polarization-dependent reflectivity spectra R$_{s-d}$ for pressures up to $\approx$20~GPa are presented in Fig.\ \ref{R_s-d}. Features around $\omega$=2500~cm$^{-1}$ and 3700 cm$^{-1}$ are artifacts originating from multi-phonon absorptions of diamond which are not fully corrected by the normalization procedure. For \textbf{E}$\parallel$\emph{a} the reflectivity increases continuously with increasing pressure in the whole frequency range studied here. In contrast, for \textbf{E}$\parallel$\emph{b} the overall reflectivity is almost unchanged up to a pressure of $\approx$15~GPa and only above 15~GPa R$_{s-d}$ increases strongly. Furthermore, the phonon mode located at 800 cm$^{-1}$ in the \textbf{E}$\parallel$\emph{b} spectrum hardens with increasing pressure [for spectra see inset of Fig.\ \ref{R_s-d} (b)]. In Fig.\ \ref{Phonon_b} the peak position of the phonon mode is shown as a function of applied pressure: Up to 15 \nolinebreak GPa the mode hardens in a linear fashion with a pressure coefficient of $3.2\pm 0.5$~cm$^{-1}$/GPa; at around 15~GPa a discontinuous change in the frequency of the observed spectral feature occurs. \begin{figure}[t] \includegraphics[width=0.85\columnwidth]{MIRint.eps} \caption{Frequency position (filled squares) and spectral weight (open triangles) of the {\bf E}$||$$a$ MIR band as a function of pressure. Dashed lines are guides to the eye.} \label{bandpos} \end{figure} The pressure-dependent real part $\sigma_1$ of the optical conductivity obtained from the Drude-Lorentz fits is presented in Fig.\ \ref{sigma1}. With increasing pressure the MIR band observed in the {\bf E}$\parallel$$a$ optical conductivity shifts to lower frequencies and its oscillator strength increases. This MIR band is superimposed by a relatively narrow peak at $\approx$1200~cm$^{-1}$, whose oscillator strength strongly increases above 15~GPa. For the polarization {\bf E}$\parallel$$b$ gradual changes set in at $\approx 10$~GPa. With increasing pressure the absorption band located at around 7000~cm$^{-1}$ for the lowest pressure looses oscillator strength and the spectral weight moves to the frequency range 4000 to 5000~cm$^{-1}$. A massive redistribution of spectral weight occurs between 14 and 16~GPa. Furthermore, at around $\approx15$~GPa a significant increase of the optical conductivity in the low-frequency part ($<$2000 \nolinebreak cm$^{-1}$) of the \textbf{E}$\parallel$\emph{b} spectrum is observed. Upon releasing pressure, the pressure-dependent trends, e.g., overall increase of reflectivity for {\bf E}$\parallel$$a$, the sudden change in frequency of the {\bf E}$\parallel$$b$ phonon mode and the redistribution of spectral weight in the high frequency range, are reversible. \section{Discussion} \label{sectiondiscussion} \subsection{Low-pressure regime: $P<15$~GPa} In the low-pressure regime ($P<15$~GPa) the changes in the optical response with increasing pressure are conti\-nu\-ous. In the {\bf E}$||$$b$ optical conductivity spectrum there is a small redistribution of the high-frequency spectral weight near $\approx$7000~cm$^{-1}$ towards lower frequency. That spectral weight may be due to charge transfer excitations, and the pressure-induced redistribution may reflect subtle alterations in the crystal structure,\cite{Loa04} causing changes in the electronic band structure. For {\bf E}$||$$a$ one finds a monotonic redshift and spectral weight growth of the pronounced MIR band with increasing pressure. Based on Drude-Lorentz fits of the reflectivity spectra, the contribution of the MIR band to the optical conductivity was extracted. The zero crossing of the first derivative of this contribution served as an estimate for the frequency position of the band. The so-obtained position of the {\bf E}$||$$a$ MIR band is plotted in Fig.\ \ref{bandpos} as a function of applied pressure. In addition, we show the pressure dependence of its spectral weight which increases by a factor of two for pressures up to 20~GPa. Based on its absolute strength and pressure dependence, the MIR band can be interpreted in terms of (i) excitations of purely electronic character and (ii) excitations involving electron-phonon coupling, i.e., polaronic excitations. For the interpretation of the MIR band in terms of purely electronic excitations, it is instructive to compare the ambient-pressure spectrum of LaTiO$_{3.41}$ with that of the Mott-Hubbard insulator LaTiO$_{3.0}$. For LaTiO$_{3.0}$ the increase of the optical conductivity at around 700 \nolinebreak cm$^{-1}$ is due to excitations from the lower to the upper Hubbard band.\cite{Lunkenheimer03,Arima03,Katsufuji95,Okimoto95,Crandles94} Upon hole doping, additional excitations within the Mott-Hubbard gap were theoretically predicted \cite{Jarrel95,Rozenberg96} and experimentally demonstrated:\cite{Taguchi93,Okimoto95,Katsufuji95} namely, a coherent Drude term and an incoherent MIR band due to transitions between the quasi-particle peak at the Fermi energy to the upper Hubbard band (or from the lower Hubbard band to the quasi-particle peak). In analogy, assuming a Mott-Hubbard picture, LaTiO$_{3.41}$ with an electronic configuration 3d$^{0.18}$ is in a highly hole-doped regime, and the {\bf E}$||$$a$ MIR band could be attributed to the predicted incoherent inner-gap excitations. The observed pressure-induced redshift and spectral weight growth of the MIR band reminds one of the doping- or thermally-induced changes of the incoherent MIR band in Mott-Hubbard systems. \cite{Imada98} Accordingly, the pressure-induced effects in LaTiO$_{3.41}$ could be attributed to the bandwidth-controlled delocalization of charges. It is interesting to compare the crystal structure of LaTiO$_{3.41}$ with that of the Mott-Hubbard system LaTiO$_{3.0}$:\cite{Cwik03} At ambient conditions, the crystal structure of LaTiO$_{3.0}$ is of the orthorhombic GdFeO$_3$-type with characteristic tiltings and distortions of the TiO$_6$ octahedra. The Ti-O1 bond length and Ti-O1-Ti bond angle (with O1 denoting the apex oxygen ion) influence the $3d$ electron bandwidth,\cite{Taguchi93} and amount to 2.03 \AA\ and 154$^{\circ}$, respectively.\cite{Cwik03} A three-dimensional network of tilted and distorted TiO$_6$ octahedra is also present in LaTiO$_{3.41}$ within an ($a$,$b$)-slab. Each slab consists of five chains of TiO$_6$ octahedra along the $a$ axis and connected via their apical oxygen ions. Within a slab, the octahedral tiltings and distortions are not homogeneous, but the largest average Ti-O1-Ti bond angle (163$^{\circ}$) and smallest average Ti-O1 bond length (1.99 \AA) are present within the chain at the symmetrical position in the middle of the slab. Interestingly, in LaTiO$_{3.0}$ a pressure-induced insulator-to-metal transition is observed for Ti-O1 bond lengths just below 2 \nolinebreak \AA. \cite{Loa05} This suggests that in LaTiO$_{3.41}$ the central chains within the slabs play a key role for the observed conducting properties of this compound. The other scenario for the interpretation of the pronounced asymmetric {\bf E}$||$$a$ MIR absorption band of LaTiO$_{3.41}$ is in terms of an optical signature of polaronic quasi-particles that are formed due to electron-phonon interaction.\cite{Emin93} Within a polaronic picture, the frequency position of the MIR band is a measure of the polaronic binding energy and thus of the electron-phonon coupling strength. Such a MIR absorption band was found in several well-studied materials, like cuprates,\cite{Bi93a,Falck93,Calvani96b,Lupi98,Lupi99} manganites,\cite{Calvani96a,Kim98,Hartinger04} and nickelates.\cite{Bi93a,Calvani96a,Bi93b,Crandles93} Also several titanium oxides show the characteristic absorption feature of polarons in the MIR frequency range,\cite{Bogomolov68,Gerthsen65,Eagles84,Calvani93,Kabanov95} and also for LaTiO$_{3.41}$ such a picture had been suggested to explain the pronounced MIR band for {\bf E}$||$$a$.\cite{Kuntscher03} In the case of the manganites it was demonstrated that the MIR band is very sensitive to the application of chemical or external pressure, see e.g. Refs.~\onlinecite{Loa01,Congeduti01,Postorino03}. In the case of doped manganites\cite{Congeduti01,Postorino03}, pressure effects were attributed to tuning the strength of the electron-phonon coupling and thus the extent of the localization of the charges. In general, a broadening of the electronic bands, i.e., an enhancement of the electron itineracy, and a stiffening of the lattice is expected upon pressure application. As a consequence, the electron-phonon coupling and therefore the polaronic binding energy should decrease. So a shift of the MIR band to lower energies and an increase of the oscillator strength, indicating an enhanced delocalization of the charge carriers, are then expected. This is in agreement with the observed pressure-induced changes of the MIR absorption feature in LaTiO$_{3.41}$ [see Figs.\ \ref{sigma1}(a) and \ref{bandpos}]. \begin{figure}[t] \includegraphics[width=0.85\columnwidth]{sigma_ch} \caption{Real part of the {\bf E}$||$$b$ optical conductivity at three different frequencies (1600, 4600, and 7400~cm$^{-1}$) as a function of pressure (extracted from Fig.\ \ref{sigma1}). The dotted vertical line indicates the pressure where the structural phase transition reported earlier \cite{Loa04} occurs in the optical present optical study. Dashed lines are guides to the eye.} \label{changes} \end{figure} Thus, based on the pressure dependence of the MIR band it is difficult to draw a conclusion on the question whether this absorption feature is to be explained by a Mott-Hubbard or a polaronic scenario. For both the Mott-Hubbard and the polaron model several examples exist, where the distinct doping dependences of the spectral features were demonstrated. \cite{{Katsufuji95,Taguchi93,Calvani96b,Lupi99,Bi93b}} Thus, also in the case of the titanate LaTiO$_{3.41}$ the doping dependence of the MIR absorption band might be an important additional piece of information. Further insight could be obtained by a detailed lineshape analysis of the absorption band. \subsection{High-pressure regime: $P>15$~GPa} Near 15~GPa we observe discontinuous changes in the optical response: (i) The oscillator strength of the narrow peak superposing the MIR band for the po\-la\-ri\-zation {\bf E}$||$$a$ increases. (ii) For {\bf E}$||$$b$ a pronounced redistribution of spectral weight from high ($\approx$7400 cm$^{-1}$) to lower ($\approx$4600~cm$^{-1}$) frequencies occurs, indicating the shift of the broad {\bf E}$||$$b$ excitation band. (iii) There is a sudden change in frequency of the vibrational excitation showing up in the MIR spectra (see Fig.\ \ref{Phonon_b}). (iv) In the low-frequency part ($\omega$$<$2000~cm$^{-1}$) the optical conductivity perpendicular to the chains, {\bf E}$||$$b$, remains almost constant in the lower pressure range, and starts to increase above $\approx$15~GPa (see changes at 1600 cm$^{-1}$ illustrated in Fig.\ \ref{changes}). These discontinuities are most probably related to the pressure-induced structural phase transition, which was observed at 18~GPa by x-ray diffraction measurements under more hydrostatic conditions.\cite{Loa04} Due to the large number of overlapping reflections, the high-pressure crystal structure could not be determined; a reversible distortion of the low-pressure crystal structure was suggested.\cite{Loa04} According to our optical data, the structural transition affects both the vibrational and electronic excitations of the system. Above the phase transition, i.e., for $P>15$~GPa, the broad {\bf E}$||$$b$ excitation band is located at $\approx$5000~cm$^{-1}$ and remains almost unchanged when increasing the pressure. The abrupt increase of the low-frequency part ($\omega<2000$~cm$^{-1}$) of the optical conductivity spectrum {\it perpendicular} to the chains deserves special attention. It cannot be simply explained by the redshift of the higher-lying broad band. An additional oscillator below 2000~cm$^{-1}$ needs to be included to describe the high-pressure (i.e., $P>15$~GPa) reflectivity spectra with the Drude-Lorentz model. This suggests the onset of a pressure-induced dimensional crossover of the system at 15~GPa, i.e., a significant increase of the hopping integral perpendicular to the chains. However, the anisotropy of the material is preserved up to the highest applied pressure (19.5~GPa), since the overall optical conductivity for {\bf E}$||$$a$ remains higher compared to {\bf E}$||$$b$. \section{Summary} We studied the polarization-dependent mid-infrared reflectivity of the quasi-1D conducting titanate LaTiO$_{3.41}$ as a function of pressure. Below 15~GPa the changes with increasing pressure are continuous for both polarizations studied: For {\bf E}$\parallel$$a$ the overall reflectivity increases; the corresponding optical conductivity contains a pronounced MIR absorption band showing a redshift and an increase of spectral weight with increasing pressure. Based on its pressure dependence, this MIR band can be interpreted in terms of electronic transitions within a Mott-Hubbard picture in the hole-doped regime, but the pressure-induced changes may also be consistent with an interpretation in terms of polaronic excitations. Additional information, like the doping dependence, is called for, in order to be able to distinguish between the two possible scenarios. For {\bf E}$\parallel$$b$ almost no change in the reflectivity spectra is induced with increasing pressure up to 15~GPa; only a small redistribution of spectral weight towards lower frequencies is observed. Near 15~GPa, discontinuous changes are clearly observed in the optical response. However, the optical anisotropy of the low-pressure phase persists in the regime of the high-pressure phase. This indicates a well-defined orientational relationship between low-pressure and high-pressure phases. The dominant change of the optical response at the phase transition occurs for {\bf E}$\parallel$$b$: a pronounced redshift of the excitation band, a sudden change in frequency of the phonon mode, and an increase of the low-frequency optical conductivity. These changes can be related to the recently observed\cite{Loa04} pressure-induced structural phase transition, which alters the electronic band structure and induces the onset of a dimensional crossover in this highly anisotropic system. \subsection*{Acknowledgements} We thank M. Dressel, S. Schuppler, and H. Winter for fruitful discussions and G. Untereiner for technical assistance. We acknowledge the ANKA Angstr\"omquelle Karlsruhe for the provision of beamtime and we would like to thank D. Moss, Y.-L. Mathis, B. Gasharova, and M. S\"upfle for assistance using the beamline ANKA-IR. Financial support by the BMBF (project No.\ 13N6918/1) and the DFG (Emmy Noether-program) is acknowledged.
{ "redpajama_set_name": "RedPajamaArXiv" }
6,593
The stellate ganglion (SG) is defined as the first thoracic ganglion (a bundle of nerves in the upper chest) or the conjoined first thoracic ganglion with the lowest cervical ganglion. In certain conditions, pain is transmitted through the sympathetic pathway. In the head and neck and upper extremity, this sympathetic pathway travels via the SG. Thus, the SG block aims to interrupt sympathetically mediated pain that travels through this relay. ARE STELLATE GANGLION BLOCKS RIGHT FOR ME? How do stellate ganglion blocks work to control my pain? After careful placement of the needle using fluoroscopic guidance, at the base of the neck (at the level of the C7 or T1 vertebral body) and location confirmed using contrast dye, therapeutic medication is injected incrementally. The injectate disrupts the transmission signaling of the sympathetic nerves and thus sympathetically mediated pain. The sympathetic nerve block, depending on the condition it is treating, may be utilized as a single, isolated injection or may be repeated frequently depending on therapeutic benefit and efficacy. It is important to speak with your pain physician about the frequency of sympathetic blocks that may be necessary. For conditions such as CRPS, there is no consensus on the number of blocks needed to result in maximum benefit and patients benefit from a single injection or a series of injections in sequence. With the stellate ganglion blockade, it is important to understand what is anticipated side effects of the procedure as well as potential complications. Transient eyelid droop, pupil changes, and lack of sweating as well as nasal stuffiness are all anticipated after the injection (a sign the sympathetic blockade is working); additionally one will notice decreased sweating of the affected limb and increase in skin temperature (on average 3 degrees C). It is very important you discuss with your pain physician the expected and associated effects of sympathetic nervous system blockade so that you know what to expect the day of the procedure. Once the sympathetic blockade has been established, one should notice a progressive decrease in the sympathetically mediated pain. It is important to speak with your pain physician about the frequency of repeating sympathetic blocks.
{ "redpajama_set_name": "RedPajamaC4" }
6,213
MTRCB Board Members visit WMSU for a forum Representatives from the Movie and Television Review and Classification Board, better known as MTRCB visited the Western Mindanao State University on Friday, August 22 for a forum, discussing the basic functions of the organization to students from the Elementary, High School and College departments. Several MTRCB Board Members spoke of the forum where hundreds of students registered and participated in the question and answer opportunity in between topics. The theme of the 2014 MTRCB forum was "Para sa Matalinong Panonood ng Pamilya nina Juan at Juana." Atty. Noel del Prado talked on the powers, functions and the basic guiding principles of the MTRCB including the monitoring of TV programs before they are aired, the classification and reviewing of movies to be screened and how the board reprimands celebrities according to their actions and misdemeanors while on air. The Review Process and the Revised Classification Ratings for Television was, on the other hand, discussed by Ms. Francia Conrado. She narrated how the TV programs are classified according to theme and how these shows are labeled with: G (General Patronage), PG (Parental Guidance), SPG (Strong Parental Guidance) and X (Not for Public Exhibition). As for the Classification Ratings for Movies, renowned Film Critic Mario Hernando was the resource speaker. He further discussed the other ratings of movies according to sensitivity of audiences including the R-13, R-16, R-18 and so on. Jackie Aquino, daughter of former Senator Agapito "Butz" Aquino was among the representatives who visited the university. She answered the queries raised by the students, who according to her were exceptionally impressive. The MTRCB Board Members were welcomed by the Vice President for Research, Development and Extension, Dr. Roberto B. Torres and the WMSU faculty and students at the Covered Court. (Mandy Dalugdug – PAO, WMSU)
{ "redpajama_set_name": "RedPajamaCommonCrawl" }
8,222
/***************************************************************************/ /* */ /* ttload.h */ /* */ /* Load the basic TrueType tables, i.e., tables that can be either in */ /* TTF or OTF fonts (specification). */ /* */ /* Copyright 1996-2001, 2002, 2005 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ /* modified, and distributed under the terms of the FreeType project */ /* license, LICENSE.TXT. By continuing to use, modify, or distribute */ /* this file you indicate that you have read the license and */ /* understand and accept it fully. */ /* */ /***************************************************************************/ #ifndef __TTLOAD_H__ #define __TTLOAD_H__ #include <ft2build.h> #include FT_INTERNAL_STREAM_H #include FT_INTERNAL_TRUETYPE_TYPES_H FT_BEGIN_HEADER FT_LOCAL( TT_Table ) tt_face_lookup_table( TT_Face face, FT_ULong tag ); FT_LOCAL( FT_Error ) tt_face_goto_table( TT_Face face, FT_ULong tag, FT_Stream stream, FT_ULong* length ); FT_LOCAL( FT_Error ) tt_face_load_sfnt_header( TT_Face face, FT_Stream stream, FT_Long face_index, SFNT_Header sfnt ); FT_LOCAL( FT_Error ) tt_face_load_directory( TT_Face face, FT_Stream stream, SFNT_Header sfnt ); FT_LOCAL( FT_Error ) tt_face_load_any( TT_Face face, FT_ULong tag, FT_Long offset, FT_Byte* buffer, FT_ULong* length ); FT_LOCAL( FT_Error ) tt_face_load_header( TT_Face face, FT_Stream stream ); FT_LOCAL( FT_Error ) tt_face_load_metrics_header( TT_Face face, FT_Stream stream, FT_Bool vertical ); FT_LOCAL( FT_Error ) tt_face_load_cmap( TT_Face face, FT_Stream stream ); FT_LOCAL( FT_Error ) tt_face_load_max_profile( TT_Face face, FT_Stream stream ); FT_LOCAL( FT_Error ) tt_face_load_names( TT_Face face, FT_Stream stream ); FT_LOCAL( FT_Error ) tt_face_load_os2( TT_Face face, FT_Stream stream ); FT_LOCAL( FT_Error ) tt_face_load_postscript( TT_Face face, FT_Stream stream ); FT_LOCAL( FT_Error ) tt_face_load_hdmx( TT_Face face, FT_Stream stream ); FT_LOCAL( FT_Error ) tt_face_load_pclt( TT_Face face, FT_Stream stream ); FT_LOCAL( void ) tt_face_free_names( TT_Face face ); FT_LOCAL( void ) tt_face_free_hdmx ( TT_Face face ); FT_LOCAL( FT_Error ) tt_face_load_gasp( TT_Face face, FT_Stream stream ); #ifdef TT_CONFIG_OPTION_EMBEDDED_BITMAPS FT_LOCAL( FT_Error ) tt_face_load_bitmap_header( TT_Face face, FT_Stream stream ); #endif /* TT_CONFIG_OPTION_EMBEDDED_BITMAPS */ FT_END_HEADER #endif /* __TTLOAD_H__ */ /* END */
{ "redpajama_set_name": "RedPajamaGithub" }
3,720
class Worklog < ActiveRecord::Base include HourlyRateHelper include TotalHelper total_and_currency_for attribute_name: :total, cents_attribute: :total_cents attr_accessible :client_id, :end_time, :start_time, :user_id, :hourly_rate, :hourly_rate_cents, :total, :summary, :from_date, :from_time, :to_date, :to_time, :team_id, :timeframes attr_accessor :from_date, :from_time, :to_date, :to_time default_scope -> { where(deleted_at: nil) } def self.deleted self.unscoped.where('deleted_at IS NOT NULL') end belongs_to :user belongs_to :client belongs_to :client_share belongs_to :invoice belongs_to :team has_many :timeframes validates :user, :client, presence: true before_validation :set_client_share after_create :email_user_of_shared_client_worklog scope :paid, -> { where.not(invoice_id: nil) } scope :unpaid, -> { where(invoice_id: nil) } scope :no_invoice, -> { where(invoice_id: nil) } scope :oldest_first, -> { order("end_time ASC") } scope :today, ->(scope) { where(id: scope.joins(:timeframes).having("MAX(timeframes.ended) >= ?", Time.zone.now.midnight).group("worklogs.id")) } scope :this_week, ->(scope) { where(id: scope.joins(:timeframes).having("MAX(timeframes.ended) BETWEEN ? AND ?", Time.zone.now.beginning_of_week, Time.zone.now).group("worklogs.id")) } scope :this_month, ->(scope) { where(id: scope.joins(:timeframes).having("MAX(timeframes.ended) BETWEEN ? AND ?", Time.zone.now.beginning_of_month, Time.zone.now).group("worklogs.id")) } scope :older_than_this_month, ->(scope) { where(id: scope.joins(:timeframes).having("MAX(timeframes.ended) < ?", Time.zone.now.beginning_of_month).group("worklogs.id")) } scope :last_month, ->(scope) { where(id: scope.joins(:timeframes).having("MAX(timeframes.ended) BETWEEN ? AND ?", (Time.zone.now.beginning_of_month - 1.month), Time.zone.now.beginning_of_month).group("worklogs.id")) } def self.to_csv(worklogs) CSV.generate do |csv| csv << self.columns_to_export worklogs.each do |worklog| csv << worklog.array_data_to_export end end end def self.range_duration_seconds(worklogs) return 0 if worklogs.empty? worklogs.map(&:duration).inject(:+) end def self.hours_from_seconds(seconds) seconds / 1.hour end def self.remaining_minutes_from_seconds(seconds) seconds / 1.minute % 60 end def self.columns_to_export ["Client", "Start time", "End time", "Hours", "Minutes", "Hourly Rate", "Total", "Summary"] end def self.updated_since(unixtimestamp) self.unscoped.where("updated_at >= ?", Time.at(unixtimestamp.to_i).to_datetime) end def array_data_to_export [client.name, I18n.localize(start_time), I18n.localize(end_time), duration_hours, duration_minutes, hourly_rate, total.to_s, summary] end def invoiced? invoice_id end def yes_or_no_boolean(boolean_var) boolean_var ? "Yes" : "No" end def duration timeframes.map(&:duration).inject(:+) || 0 end def duration_hours self.class.hours_from_seconds duration end def duration_minutes self.class.remaining_minutes_from_seconds duration end def title "#{end_time.strftime("%d.%m.%Y")} - #{duration_hours.to_s}h:#{duration_minutes.to_s}min. #{total.to_s}#{total.currency.symbol}" end def invoice_title(invoice) "Work: #{end_time.strftime("%d.%m.%Y")} - #{duration_hours.to_s}h:#{duration_minutes.to_s}min x #{hourly_rate}#{hourly_rate.currency.symbol}" end def start_time timeframes.order("started ASC").limit(1).first.started end def end_time timeframes.order("ended desc").limit(1).first.ended end # returns the client share that links this worklog to the original user and # the user that owns the worklog. def client_share client.client_shares.where(user_id: self.user_id).first end def client_subcontractor_name_or_username client_share.try(:subcontractor_shown_name).present? ? client_share.subcontractor_shown_name : user.username end def created_for_shared_client? # We own the client if user.clients.where(id: client_id).any? false else true end end def created_for_user if created_for_shared_client? client.user else user end end def email_user_of_shared_client_worklog if created_for_shared_client? && client.email_when_team_adds_worklog begin WorklogMailer.worklog_for_shared_client_created(self).deliver rescue => e Rails.logger.fatal "Could not deliver worklog message: #{e.message.to_s} - #{e.backtrace.join("\n")}" end end true end def not_set_by_user # This check only works for new records, as the hourly rate is persisted # after. return if !new_record? hourly_rate.cents == 0 end # Freshly calculate the total from each timeframe of the worklog. def calc_total duration.to_f / 1.hour.to_f * hourly_rate.to_f end def set_client_share if user && client && created_for_shared_client? self.client_share = user.client_shares.where(client_id: self.client_id).first end true end end
{ "redpajama_set_name": "RedPajamaGithub" }
5,180
Q: What's the difference between HEAD and HEAD~1? It was suggested to me that I could restore my code to the way it is in the origin repository using this command: git reset --soft HEAD~1 I looked for information on this but didn't find anything that explained HEAD~1 What does the ~1 part of the command do? A: The official documentation for this syntax is in the gitrevisions manpage. HEAD~1 means: go back 1 commit from HEAD, using the first parent (most commits have only one parent, so this syntax covers most cases where you want to go further back). HEAD~1 is so common that it can also be shortened to HEAD~. It's important to understand, though, that HEAD has little to do with the state of the origin repository! HEAD~1 will happen to match the current state of the origin in these cases: * *You just pulled (merged) from the origin, and it created a merge commit (prompted for a merge commit message). *You were up-to-date with the origin and then made a single new commit on top. In other cases you would probably use @{upstream} which references the upstream of your current branch (also documented in the gitrevisions manpage). Finally, --soft often isn't the right choice, either. It means that all your changes will be preserved in the working tree and index. Your files won't change at all, and git status will show all the changes as "to be committed". If you want to basically hit the reset button and irrevocably destroy all committed and uncommitted changes you have locally compared to the upstream, I recommend this: git reset --hard @{upstream}
{ "redpajama_set_name": "RedPajamaStackExchange" }
7,672
'use strict'; var minilog = require('minilog') , log = minilog('traverson'); function FinalAction(walker) { this.walker = walker; } FinalAction.prototype.get = function(nextStep, callback) { log.debug('next step: ' + JSON.stringify(nextStep, null, 2)); this.walker.process(nextStep, function(err, step) { log.debug('walker.process returned'); if (err) { return callback(err, step.response, step.uri); } if (!step.response && step.doc) { log.debug('faking HTTP response for embedded resource'); step.response = { statusCode: 200, body: JSON.stringify(step.doc), remark: 'This is not an actual HTTP response. The resource you ' + 'requested was an embedded resource, so no HTTP request was ' + 'made to acquire it.' }; } callback(null, step.response); }); }; FinalAction.prototype.getResource = function(nextStep, callback) { // TODO Remove duplication: This duplicates the get/checkHttpStatus/parse // sequence from the Walker's walk method. var self = this; log.debug('next step: ' + JSON.stringify(nextStep)); this.walker.process(nextStep, function(err, step) { log.debug('walker.process returned'); if (err) { return callback(err, step.response, step.uri); } if (step.doc) { // return an embedded doc immediately return callback(null, step.doc); } var resource; try { self.walker.checkHttpStatus(step); resource = self.walker.parse(step); return callback(null, resource); } catch (e) { return callback(e, e.doc); } }); }; FinalAction.prototype.getUri = function(nextStep, callback) { var self = this; log.debug('returning uri'); if (nextStep.uri) { return callback(null, nextStep.uri); } else if (nextStep.doc && nextStep.doc._links && nextStep.doc._links.self && nextStep.doc._links.self.href) { return callback(null, self.walker.startUri + nextStep.doc._links.self.href); } else { return callback(new Error('You requested an URI but the last ' + 'resource is an embedded resource and has no URI of its own ' + '(that is, it has no link with rel=\"self\"')); } }; FinalAction.prototype.walkAndExecute = function(body, request, method, callback) { var self = this; this.walker.walk(function(err, nextStep, lastStep) { log.debug('walker.walk returned'); if (err) { return callback(err, lastStep.response, lastStep.uri); } log.debug('executing final request with step: ' + JSON.stringify(nextStep)); self.executeRequest(nextStep.uri, request, method, body, callback); }); }; FinalAction.prototype.executeRequest = function(uri, request, method, body, callback) { var options; if (body) { options = { body: JSON.stringify(body) }; } else { options = {}; } log.debug('request to ' + uri + ' with options ' + JSON.stringify(options)); method.call(request, uri, options, function(err, response) { log.debug('request to ' + uri + ' succeeded'); if (err) { return callback(err, response, uri); } return callback(null, response, uri); }); }; module.exports = FinalAction;
{ "redpajama_set_name": "RedPajamaGithub" }
3,060
CHAPTER 204B. ELECTION ADMINISTRATION; GENERAL PROVISIONS 204B.001 MS 2006 [Renumbered 15.001] 204B.01 DEFINITIONS. 204B.02 APPLICATION. CANDIDATE NOMINATION AND FILING 204B.03 MANNER OF NOMINATION. 204B.04 CANDIDACY; PROHIBITIONS. 204B.05 [Repealed, 1987 c 39 s 1] 204B.06 FILING FOR PRIMARY; AFFIDAVIT OF CANDIDACY. 204B.07 NOMINATING PETITIONS. 204B.071 PETITIONS; RULES OF SECRETARY OF STATE. 204B.08 SIGNING PETITIONS. 204B.09 TIME AND PLACE OF FILING AFFIDAVITS AND PETITIONS. 204B.10 AFFIDAVITS OF CANDIDACY; NOMINATING PETITIONS; DUTIES. 204B.11 CANDIDATES; FILING FEES; PETITION IN PLACE OF FILING FEE. 204B.12 WITHDRAWAL OF CANDIDATES. VACANCY IN NOMINATION 204B.13 VACANCY IN NOMINATION; PARTISAN OFFICE. 204B.131 VACANCY IN NOMINATION; NONPARTISAN OFFICE. ELECTION DISTRICTS; REDISTRICTING 204B.135 REDISTRICTING OF ELECTION DISTRICTS. 204B.14 ELECTION PRECINCTS. 204B.145 DUTIES OF SECRETARY OF STATE; REDISTRICTING. 204B.146 DUTIES OF SECRETARY OF STATE. 204B.15 UNORGANIZED TERRITORY; ELECTION PRECINCTS. 204B.16 POLLING PLACES; DESIGNATION. 204B.17 [Repealed, 2016 c 161 art 3 s 5] 204B.175 CHANGE OF POLLING PLACE IN AN EMERGENCY. 204B.18 POLLING PLACES; EQUIPMENT. ELECTION EMERGENCY PLANS 204B.181 ELECTION EMERGENCY PLANS. ELECTION JUDGES; APPOINTMENT AND TRAINING 204B.19 ELECTION JUDGES; QUALIFICATIONS. 204B.195 TIME OFF FROM WORK TO SERVE AS ELECTION JUDGE. 204B.20 ELECTION BOARD; HEAD ELECTION JUDGE; DUTIES. 204B.21 APPOINTMENT OF ELECTION JUDGES. 204B.22 ELECTION JUDGES; NUMBER REQUIRED. 204B.23 VACANCIES AMONG ELECTION JUDGES. 204B.24 ELECTION JUDGES; OATH. 204B.25 TRAINING FOR ELECTION JUDGES. 204B.26 ELECTION JUDGES; VIOLATIONS; PENALTIES. ELECTION ADMINISTRATION 204B.27 DUTIES OF SECRETARY OF STATE. 204B.28 CLERKS; ELECTION SUPPLIES; DUTIES. 204B.29 ELECTION JUDGES; ELECTION SUPPLIES; DUTIES. 204B.30 UNOFFICIAL BALLOTS. 204B.31 COMPENSATION FOR ELECTION SERVICES. 204B.32 ELECTION EXPENSES; PAYMENT. 204B.33 NOTICE OF FILING. 204B.34 NOTICE OF ELECTION. 204B.35 PREPARATION OF BALLOTS. 204B.36 BALLOTS; FORM. 204B.37 BACK OF BALLOT. 204B.38 NAMES ON BALLOTS; IDENTICAL DESCRIPTIVE WORDS. 204B.39 SUBSTITUTE BALLOTS. 204B.40 BALLOTS; ELECTION RECORDS AND OTHER MATERIALS; DISPOSITION; INSPECTION OF BALLOTS. 204B.42 [Repealed, 2013 c 131 art 2 s 85] 204B.43 UNLAWFUL PRINTING OR DISTRIBUTION OF BALLOTS; PENALTY. 204B.44 ERRORS AND OMISSIONS; REMEDY. BALLOTING AND ELECTIONS BY MAIL 204B.45 MAIL BALLOTING. 204B.46 MAIL ELECTIONS; QUESTIONS. 204B.47 ALTERNATIVE ELECTION PROCEDURES; DUTIES OF SECRETARY OF STATE. 204B.48 [Repealed, 1Sp2017 c 4 art 3 s 18] 204B.49 "I VOTED" STICKERS. The definitions in chapter 200 apply to this chapter. 1981 c 29 art 4 s 1 This chapter applies to all elections held in this state except as otherwise provided by law. 1981 c 29 art 4 s 2; 1987 c 266 art 1 s 23 Candidates of a major political party for any partisan office except presidential elector and all candidates for nonpartisan office shall apply for a place on the primary ballot by filing an affidavit of candidacy as provided in section 204B.06, and except as otherwise provided in section 204D.07, subdivision 3, shall be nominated by primary. Candidates for any partisan office who do not seek the nomination of a major political party shall be nominated by nominating petition as provided in sections 204B.07 and 204B.08, and, except for presidential elector candidates, shall file an affidavit of candidacy as provided in section 204B.06. 1981 c 29 art 4 s 3; 1986 c 475 s 7 Subdivision 1.Major party candidates. No individual shall be named on any ballot as the candidate of more than one major political party. No individual who has been certified by a canvassing board as the nominee of any major political party shall be named on any ballot as the candidate of any other major political party at the next ensuing general election. Subd. 2.Candidates seeking nomination by primary. No individual who seeks nomination for any partisan or nonpartisan office at a primary shall be nominated for the same office by nominating petition. [Expired] Subd. 3.Nomination for nonpartisan office. No individual shall be nominated by nominating petition for any nonpartisan office. Subd. 4.Prohibition on multiple candidacy. A candidate who files an affidavit of candidacy for an office to be elected at the general election may not subsequently file another affidavit of candidacy for any other office to be elected on the date of that general election, unless the candidate withdraws the initial affidavit pursuant to section 204B.12. The provisions in section 645.21 do not apply to this subdivision. Subd. 5.Ballots; candidates who file by nominating petition. Candidates who were filed as a team by nominating petition under section 204B.07, subdivision 2, shall not appear on the ballot as minor party or independent candidates if either candidate is certified as a major party candidate for president or vice president pursuant to section 208.03. 1981 c 29 art 4 s 4; 1991 c 320 s 4; 1996 c 419 s 4,5,10; 2010 c 201 s 22; 2011 c 65 s 1; 2012 c 187 art 1 s 28; 2013 c 131 art 2 s 21; 2016 c 161 art 1 s 4 Subdivision 1.Form of affidavit. An affidavit of candidacy shall state the name of the office sought and, except as provided in subdivision 4, shall state that the candidate: (1) is an eligible voter; (2) has no other affidavit on file as a candidate for any office at the same primary or next ensuing general election, except that a candidate for soil and water conservation district supervisor in a district not located in whole or in part in Anoka, Hennepin, Ramsey, or Washington County, may also have on file an affidavit of candidacy for mayor or council member of a statutory or home rule charter city of not more than 2,500 population contained in whole or in part in the soil and water conservation district or for town supervisor in a town of not more than 2,500 population contained in whole or in part in the soil and water conservation district; and (3) is, or will be on assuming the office, 21 years of age or more, and will have maintained residence in the district from which the candidate seeks election for 30 days before the general election. An affidavit of candidacy must include a statement that the candidate's name as written on the affidavit for ballot designation is the candidate's true name or the name by which the candidate is commonly and generally known in the community. An affidavit of candidacy for partisan office shall also state the name of the candidate's political party or political principle, stated in three words or less. [Repealed, 1Sp2001 c 10 art 18 s 44] Subd. 1b.Address and telephone number. (a) An affidavit of candidacy must state a telephone number where the candidate can be contacted. An affidavit must also state the candidate's address of residence as determined under section 200.031, or at the candidate's request in accordance with paragraph (c), the candidate's campaign contact address. The form for the affidavit of candidacy must allow the candidate to request, if eligible, that the candidate's address of residence be classified as private data, and to provide the certification required under paragraph (c) for classification of that address. (b) For an office whose residency requirement must be satisfied by the close of the filing period, a registered voter in this state may request in writing that the filing officer receiving the affidavit of candidacy review the address as provided in this paragraph, at any time up to one day after the last day for filing for office. If requested, the filing officer must determine whether the address provided in the affidavit of candidacy is within the area represented by the office the candidate is seeking. If the filing officer determines that the address is not within the area represented by the office, the filing officer must immediately notify the candidate and the candidate's name must be removed from the ballot for that office. A determination made by a filing officer under this paragraph is subject to judicial review under section 204B.44. (c) If the candidate requests that the candidate's address of residence be classified as private data, the candidate must list the candidate's address of residence on a separate form to be attached to the affidavit. The candidate must also certify on the affidavit that a police report has been submitted or an order for protection has been issued in regard to the safety of the candidate or the candidate's family, or that the candidate's address is otherwise private pursuant to Minnesota law. The address of residence provided by a candidate who makes a request for classification on the candidate's affidavit of candidacy and provides the certification required by this paragraph is classified as private data, as defined in section 13.02, subdivision 12, but may be reviewed by the filing officer as provided in this subdivision. (d) The requirements of this subdivision do not apply to affidavits of candidacy for a candidate for: (1) judicial office; (2) the office of county attorney; or (3) county sheriff. Subd. 2.Major party candidates. A candidate who seeks the nomination of a major political party for a partisan office shall state on the affidavit of candidacy that the candidate either participated in that party's most recent precinct caucus or intends to vote for a majority of that party's candidates at the next ensuing general election. [Repealed, 1983 c 253 s 26] Subd. 4.Federal offices. Candidates for president or vice president of the United States are not required to file an affidavit of candidacy for office. Candidates who seek nomination for the office of United States senator or representative shall state the following information on the affidavit: (1) for United States senator, that the candidate will be an inhabitant of this state when elected and will be 30 years of age or older and a citizen of the United States for not less than nine years on the next January 3 or, in the case of an election to fill a vacancy, within 21 days after the special election; and (2) for United States representative, that the candidate will be an inhabitant of this state when elected and will be 25 years of age or older and a citizen of the United States for not less than seven years on the next January 3 or, in the case of an election to fill a vacancy, within 21 days after the special election. Subd. 4a.State and local offices. Candidates who seek nomination for the following offices shall state the following additional information on the affidavit: (1) for governor or lieutenant governor, that on the first Monday of the next January the candidate will be 25 years of age or older and, on the day of the state general election, a resident of Minnesota for not less than one year; (2) for supreme court justice, court of appeals judge, or district court judge, that the candidate is learned in the law; (3) for county, municipal, school district, or special district office, that the candidate meets any other qualifications for that office prescribed by law; (4) for senator or representative in the legislature, that on the day of the general or special election to fill the office the candidate will have resided not less than one year in the state and not less than six months in the legislative district from which the candidate seeks election. Subd. 5.United States senator; two candidates at same election. When two candidates are to be elected United States senators from this state at the same election, each individual filing for the nomination shall state in the affidavit of candidacy the term for which the individual desires to be a candidate, by stating the date of the expiration of the term. Subd. 6.Judicial candidates; designation of term. An individual who files as a candidate for the office of chief justice or associate justice of the supreme court, judge of the court of appeals, or judge of the district court shall state in the affidavit of candidacy the office of the particular justice or judge for which the individual is a candidate. The individual shall be a candidate only for the office identified in the affidavit. Each justice of the supreme court and each court of appeals and district court judge is deemed to hold a separate nonpartisan office. Subd. 7.Governor and lieutenant governor. An individual who files as a candidate for governor or lieutenant governor shall file the affidavit of candidacy jointly with the affidavit of another individual who seeks nomination as a candidate for the other office. Subd. 8.Proof of eligibility. A candidate for judicial office or for the office of county attorney shall submit with the affidavit of candidacy proof that the candidate is licensed to practice law in this state. Proof means providing a copy of a current attorney license. A candidate for county sheriff shall submit with the affidavit of candidacy proof of licensure as a peace officer in this state. Proof means providing a copy of a current Peace Officer Standards and Training Board license. 1981 c 29 art 4 s 6; 1982 c 501 s 14; 1983 c 247 s 83,84; 1986 c 444; 1986 c 475 s 8; 1990 c 603 s 2; 1993 c 223 s 7,8; 1995 c 222 s 2; 1996 c 419 s 6,10; 1997 c 147 s 26; 1Sp2001 c 10 art 18 s 16; 2004 c 293 art 2 s 14; 2005 c 156 art 6 s 31,32; 2008 c 244 art 2 s 16; 2010 c 314 s 2; 2015 c 70 art 1 s 20 Subdivision 1.Form of petition. A nominating petition may consist of one or more separate pages each of which shall state: (a) the office sought; (b) the candidate's name and residence address, including street and number if any; and (c) the candidate's political party or political principle expressed in not more than three words. No candidate who files for a partisan office by nominating petition shall use the term "nonpartisan" as a statement of political principle or the name of the candidate's political party. No part of the name of a major political party may be used to designate the political party or principle of a candidate who files for a partisan office by nominating petition, except that the word "independent" may be used to designate the party or principle. A candidate who files an affidavit of candidacy to fill a vacancy in nomination for a nonpartisan office pursuant to section 204B.13, shall not state any political principle or the name of any political party on the petition. Subd. 2.Petitions for presidential electors and alternates. This subdivision does not apply to candidates for presidential elector or alternate nominated by major political parties. Major party candidates for presidential elector or alternate are certified under section 208.03. Other presidential electors or alternates are nominated by petition pursuant to this section. On petitions nominating presidential electors or alternates, the names of the candidates for president and vice-president shall be added to the political party or political principle stated on the petition. One petition may be filed to nominate a slate of presidential electors equal in number to the number of electors to which the state is entitled and an alternate for each elector nominee. Subd. 3.Number of candidates nominated. No nominating petition shall contain the name of more than one candidate except a petition jointly nominating individuals for governor and lieutenant governor or nominating a slate of presidential electors. Subd. 4.Oath and address of signer. Following the information required by subdivisions 1 and 2 and before the space for signing, each separate page that is part of the petition shall include an oath in the following form: "I solemnly swear (or affirm) that I know the contents and purpose of this petition, that I do not intend to vote at the primary election for the office for which this nominating petition is made, and that I signed this petition of my own free will." Notarization or certification of the signatures on a nominating petition is not required. Immediately after the signature, the signer shall write on the petition the signer's residence address including street and number, if any, and mailing address if different from residence address. Subd. 5.Sample forms. An official with whom petitions are filed shall make sample forms for nominating petitions available upon request. Subd. 6.Penalty. An individual who, in signing a nominating petition, makes a false oath is guilty of perjury. 1981 c 29 art 4 s 7; 1986 c 444; 1986 c 475 s 9,10; 1Sp2001 c 10 art 18 s 17; 2004 c 293 art 2 s 15; 2012 c 187 art 1 s 29; 2015 c 70 art 2 s 1 The secretary of state shall adopt rules governing the manner in which petitions required for any election in this state are circulated, signed, filed, and inspected. The secretary of state shall provide samples of petition forms for use by election officials. 1999 c 132 s 16 Subdivision 1.Time for signing. Nominating petitions shall be signed during the period when petitions may be filed as provided in section 204B.09. Subd. 2.Qualifications of signers. A nominating petition may be signed only by individuals who are eligible to vote for the candidate who is nominated. No individual may sign more than one nominating petition for candidates for the same office unless more than one candidate is to be elected to that office. If more than one candidate is to be elected to the office, an individual may sign as many petitions as there are candidates to be elected. Subd. 3.Number of signatures. The number of signatures required on a nominating petition shall be as follows: (a) for a federal or state office voted on statewide, one percent of the total number of individuals voting in the state at the last preceding state general election, or 2,000, whichever is less; (b) for a congressional office, five percent of the total number of individuals voting in the district at the last preceding state general election, or 1,000, whichever is less; (c) for a county or legislative office, ten percent of the total number of individuals voting in the county or legislative district at the last preceding state or county general election, or 500, whichever is less; (d) for a municipal office in a city of the first class, the number specified in section 205.121; and (e) for any other municipal or school district office, ten percent of the total number of individuals voting in the municipality, ward, school district, or other election district at the last preceding municipal, or school district if applicable, general election, or 500, whichever is less. 1981 c 29 art 4 s 8; 1990 c 453 s 3; 1999 c 132 s 17; 2008 c 244 art 2 s 17 Subdivision 1.Candidates in state and county general elections. (a) Except as otherwise provided by this subdivision, affidavits of candidacy and nominating petitions for county, state, and federal offices filled at the state general election shall be filed not more than 84 days nor less than 70 days before the state primary. The affidavit may be prepared and signed at any time between 60 days before the filing period opens and the last day of the filing period. (b) Notwithstanding other law to the contrary, the affidavit of candidacy must be signed in the presence of a notarial officer or an individual authorized to administer oaths under section 358.10. (c) This provision does not apply to candidates for presidential elector nominated by major political parties. Major party candidates for presidential elector are certified under section 208.03. Other candidates for presidential electors may file petitions at least 77 days before the general election day pursuant to section 204B.07. Nominating petitions to fill vacancies in nominations shall be filed as provided in section 204B.13. No affidavit or petition shall be accepted later than 5:00 p.m. on the last day for filing. (d) Affidavits and petitions for county offices must be filed with the county auditor of that county. Affidavits and petitions for federal offices must be filed with the secretary of state. Affidavits and petitions for state offices must be filed with the secretary of state or with the county auditor of the county in which the candidate resides. (e) Affidavits other than those filed pursuant to subdivision 1a must be submitted by mail or by hand, notwithstanding chapter 325L, or any other law to the contrary and must be received by 5:00 p.m. on the last day for filing. Subd. 1a.Absent candidates. (a) A candidate for special district, county, state, or federal office who will be absent from the state during the filing period may submit a properly executed affidavit of candidacy, the appropriate filing fee, and any necessary petitions in person to the filing officer. The candidate shall state in writing the reason for being unable to submit the affidavit during the filing period. The affidavit, filing fee, if any, and petitions must be submitted to the filing officer during the seven days immediately preceding the candidate's absence from the state. Nominating petitions may be signed during the 14 days immediately preceding the date when the affidavit of candidacy is filed. (b) A candidate for special district, county, state, or federal office who will be absent from the state during the entire filing period or who must leave the state for the remainder of the filing period and who certifies to the secretary of state that the circumstances constitute an emergency and were unforeseen, may submit a properly executed affidavit of candidacy by facsimile device or by transmitting electronically a scanned image of the affidavit to the secretary of state during the filing period. The candidate shall state in writing the specific reason for being unable to submit the affidavit by mail or by hand during the filing period or in person prior to the start of the filing period. The affidavit of candidacy, filing fee, if any, and any necessary petitions must be received by the secretary of state by 5:00 p.m. on the last day for filing. If the candidate is filing for a special district or county office, the secretary of state shall forward the affidavit of candidacy, filing fee, if any, and any necessary petitions to the appropriate filing officer. Subd. 2.Other elections. Affidavits of candidacy and nominating petitions for city, town or other elective offices shall be filed during the time and with the official specified in chapter 205 or other applicable law or charter, except as provided for a special district candidate under subdivision 1a. Affidavits of candidacy and applications filed on behalf of eligible voters for school board office shall be filed during the time and with the official specified in chapter 205A or other applicable law. Affidavits of candidacy and nominating petitions filed under this subdivision must be submitted by mail or by hand, notwithstanding chapter 325L, or any other law to the contrary, and must be received by the appropriate official within the specified time for the filing of affidavits and petitions for the office. Subd. 3.Write-in candidates. (a) A candidate for county, state, or federal office who wants write-in votes for the candidate to be counted must file a written request with the filing office for the office sought not more than 84 days before the primary and no later than the seventh day before the general election. The filing officer shall provide copies of the form to make the request. No written request shall be accepted later than 5:00 p.m. on the last day for filing a written request. (b) A candidate for president of the United States who files a request under this subdivision must include the name of a candidate for vice president of the United States. The request must also include the name of at least one candidate for presidential elector. The total number of names of candidates for presidential elector on the request may not exceed the total number of electoral votes to be cast by Minnesota in the presidential election. (c) A candidate for governor who files a request under this subdivision must include the name of a candidate for lieutenant governor. 1981 c 29 art 4 s 9; 1986 c 475 s 11; 1987 c 266 art 1 s 24; 1989 c 291 art 1 s 8; 1990 c 585 s 24; 1990 c 608 art 7 s 2; 1991 c 227 s 11; 2000 c 467 s 9-11; 1Sp2001 c 10 art 18 s 18,19; 2004 c 293 art 2 s 16,17; 2008 c 244 art 1 s 10; 2010 c 184 s 12; 2014 c 264 s 14; 2017 c 92 art 1 s 13 Subdivision 1.Affidavits of candidacy; numbering. The official with whom affidavits of candidacy are filed shall number them in the order received. Subd. 2.Nominating petitions; acknowledgment; numbering. On the day a nominating petition is filed, the election official shall deliver or mail an acknowledgment of the petition to the individual who files it and to the candidate who is to be nominated. The election official shall also number the petitions in the order received. The petitions shall be retained as provided in section 204B.40, and shall be available for public inspection during that period. Subd. 3.Inspection. The official with whom nominating petitions are filed shall inspect the petitions in the order filed to verify that there are a sufficient number of signatures of individuals whose residence address as shown on the petition is in the district where the candidate is to be nominated. Subd. 4.Certification. The secretary of state shall certify to the county auditor of each county the names of all candidates nominated by petitions filed with the secretary of state. Certification shall be made at the same time as the secretary of state certifies the names of candidates who are nominated at the primary. Subd. 5.Improper name. If the filing officer determines that use on the ballot of the candidate's name as written on the affidavit of candidacy would violate section 204B.35, subdivision 2, the filing officer shall immediately notify the candidate and shall certify for the ballot the candidate's true name instead of the name as written on the affidavit. Subd. 6.Candidate's eligibility to hold office. Upon receipt of a certified copy of a final judgment or order of a court of competent jurisdiction that a person who has filed an affidavit of candidacy or who has been nominated by petition: (1) has been convicted of treason or a felony and the person's civil rights have not been restored; (2) is under guardianship in which the court order revokes the ward's right to vote; or (3) has been found by a court of law to be legally incompetent; the filing officer shall notify the person by certified mail at the address shown on the affidavit or petition, and, for offices other than President of the United States, Vice President of the United States, United States Senator, and United States Representative in Congress, shall not certify the person's name to be placed on the ballot. The actions of a filing officer under this subdivision are subject to judicial review under section 204B.44. 1981 c 29 art 4 s 10; 1986 c 475 s 12; 1993 c 364 s 1; 2005 c 10 art 4 s 6; 2005 c 156 art 6 s 33 Subdivision 1.Amount; dishonored checks; consequences. (a) Except as provided by subdivision 2, a filing fee shall be paid by each candidate who files an affidavit of candidacy. The fee shall be paid at the time the affidavit is filed. The amount of the filing fee shall vary with the office sought as follows: (1) for the office of governor, lieutenant governor, attorney general, state auditor, secretary of state, representative in Congress, judge of the supreme court, judge of the court of appeals, or judge of the district court, $300; (2) for the office of senator in Congress, $400; (3) for office of senator or representative in the legislature, $100; (4) for a county office, $50; and (5) for the office of soil and water conservation district supervisor, $20. (b) For the office of presidential elector, and for those offices for which no compensation is provided, no filing fee is required. (c) The filing fees received by the county auditor shall immediately be paid to the county treasurer. The filing fees received by the secretary of state shall immediately be paid to the commissioner of management and budget. (d) When an affidavit of candidacy has been filed with the appropriate filing officer and the requisite filing fee has been paid, the filing fee shall not be refunded. If a candidate's filing fee is paid with a check, draft, or similar negotiable instrument for which sufficient funds are not available or that is dishonored, notice to the candidate of the worthless instrument must be sent by the filing officer via registered mail no later than immediately upon the closing of the filing deadline with return receipt requested. The candidate will have five days from the time the filing officer receives proof of receipt to issue a check or other instrument for which sufficient funds are available. The candidate issuing the worthless instrument is liable for a service charge pursuant to section 604.113. If adequate payment is not made, the name of the candidate must not appear on any official ballot and the candidate is liable for all costs incurred by election officials in removing the name from the ballot. Subd. 2.Petition in place of filing fee. At the time of filing an affidavit of candidacy, a candidate may present a petition in place of the filing fee. The petition may be signed by any individual eligible to vote for the candidate. A nominating petition filed pursuant to section 204B.07 is effective as a petition in place of a filing fee if the nominating petition includes a prominent statement informing the signers of the petition that it will be used for that purpose. The number of signatures on a petition in place of a filing fee shall be as follows: (a) for a state office voted on statewide, or for president of the United States, or United States senator, 2,000; (b) for a congressional office, 1,000; (c) for a county or legislative office, or for the office of district judge, 500; and (d) for any other office which requires a filing fee as prescribed by law, municipal charter, or ordinance, the lesser of 500 signatures or five percent of the total number of votes cast in the municipality, ward, or other election district at the preceding general election at which that office was on the ballot. An official with whom petitions are filed shall make sample forms for petitions in place of filing fees available upon request. 1981 c 29 art 4 s 11; 3Sp1981 c 2 art 1 s 29; 1983 c 112 s 1; 1983 c 247 s 85; 1987 c 175 s 5; 1987 c 404 s 155; 1990 c 603 s 3; 1992 c 513 art 3 s 42; 1998 c 254 art 2 s 21,22; 2003 c 112 art 2 s 50; 2009 c 101 art 2 s 109; 2012 c 187 art 1 s 30 Subdivision 1.Before primary. A candidate may withdraw from the primary ballot by filing an affidavit of withdrawal with the same official who received the affidavit of candidacy. The affidavit shall request that official to withdraw the candidate's name from the ballot and shall be filed no later than two days after the last day for filing for the office. [Repealed, 2013 c 131 art 5 s 10] Subd. 2b.Governor's race. If a candidate for governor withdraws, the secretary of state shall remove from the ballot the name of the candidate for governor and the name of that candidate's running mate for lieutenant governor. Subd. 3.Time for filing. An affidavit of withdrawal filed under this section shall not be accepted later than 5:00 p.m. on the last day for withdrawal. 1981 c 29 art 4 s 12; 1983 c 303 s 6; 1986 c 444; 1986 c 475 s 13; 1991 c 320 s 5-7; 2000 c 467 s 12 Subdivision 1.Partisan office. (a) A vacancy in nomination for a partisan office must be filled in the manner provided by this section. A vacancy in nomination exists for a partisan office when a major political party candidate who has been nominated in accordance with section 204D.03, subdivision 3, or 204D.10, subdivision 1: (1) dies; (2) withdraws by filing an affidavit of withdrawal, as provided in paragraph (b), at least one day prior to the general election with the same official who received the affidavit of candidacy; or (3) is determined to be ineligible to hold the office the candidate is seeking, pursuant to a court order issued under section 204B.44. (b) An affidavit of withdrawal filed under paragraph (a), clause (2), must state that the candidate has been diagnosed with a catastrophic illness that will permanently and continuously incapacitate the candidate and prevent the candidate from performing the duties of the office sought, if elected. The affidavit must be accompanied by a certificate verifying the candidate's illness meets the requirements of this paragraph, signed by at least two licensed physicians. The affidavit and certificate may be filed by the candidate or the candidate's legal guardian. Subd. 2.Partisan office; nomination by party; special election. (a) Except as provided in subdivision 5, a major political party may fill a vacancy in nomination of that party's candidate as defined in subdivision 1, paragraph (a), clause (1), (2), or (3), by filing one nomination certificate with the same official who received the affidavits of candidacy for that office. A major political party may provide in its governing rules a procedure, including designation of an appropriate committee, to fill a vacancy in nomination for any federal or state partisan office. The nomination certificate shall be prepared under the direction of and executed by the chair and secretary of the political party and filed within the timelines established in this section. When filing the certificate the chair and secretary shall attach an affidavit stating that the newly nominated candidate has been selected under the rules of the party and that the individuals signing the certificate and making the affidavit are the chair and secretary of the party. (b) In the case of a vacancy in nomination for partisan office that occurs on or before the 79th day before the general election, the major political party must file the nomination certificate no later than 71 days before the general election. The name of the candidate nominated by the party must appear on the general election ballot. (c) Except as provided in subdivision 5, in the case of a vacancy in nomination for a partisan office that occurs after the 79th day before the general election, the general election ballot shall remain unchanged, but the county and state canvassing boards must not certify the vote totals for that office from the general election, and the office must be filled at a special election held in accordance with this section. Except for the vacancy in nomination, all other candidates whose names appeared on the general election ballot for the office must appear on the special election ballot for the office. New affidavits of candidacy or nominating petitions may not be accepted, and there must not be a primary to fill the vacancy in nomination. The major political party may file a nomination certificate as provided in paragraph (a) no later than seven days after the general election. On the date of the general election, the county auditor or municipal clerk shall post a notice in each precinct affected by a vacancy in nomination under this paragraph, informing voters of the reason for the vacancy in nomination and the procedures for filling the vacancy in nomination and conducting a special election as required by this section. The secretary of state shall prepare and electronically distribute the notice to county auditors in each county affected by a vacancy in nomination. Subd. 2a.Partisan office; filing period. A vacancy in nomination for a partisan office due to a withdrawal of a candidate under section 204B.12, subdivision 1, may be filled in the manner provided in sections 204B.06, 204B.09, and 204B.11, except that all documents and fees required by those sections must be filed within five days after the vacancy in nomination occurs. There must be a two-day period for withdrawal of candidates after the last day for filing. If there is more than one candidate at the end of the withdrawal period to fill the vacancy in nomination, the candidates' names must appear on the primary ballot. Otherwise, the candidate's name must appear on the general election ballot. Subd. 5.Candidates for governor and lieutenant governor. (a) If a vacancy in nomination for a major political party occurs in the race for governor, the political party must nominate the candidates for both governor and lieutenant governor. If a vacancy in nomination for a major political party occurs in the race for lieutenant governor, the candidate for governor shall select the candidate for lieutenant governor. (b) For a vacancy in nomination for lieutenant governor that occurs on or before the 79th day before the general election, the name of the lieutenant governor candidate must be submitted by the governor candidate to the filing officer no later than 71 days before the general election. If the vacancy in nomination for lieutenant governor occurs after the 79th day before the general election, the candidate for governor shall submit the name of the new lieutenant governor candidate to the secretary of state within seven days after the vacancy in nomination occurs, but no changes may be made to the general election ballots. (c) When a vacancy in nomination for lieutenant governor occurs after the 79th day before the general election, the county auditor or municipal clerk shall post a notice in each precinct affected by the vacancy in nomination. The secretary of state shall prepare and electronically distribute the notice to county auditors. The county auditor must ensure that each precinct in the county receives the notice prior to the opening of the polls on election day. The notice must include: (1) a statement that there is a vacancy in nomination for lieutenant governor and the statutory reason for the vacancy in nomination as provided in subdivision 1, paragraph (a), clause (1), (2), or (3); (2) a statement that the results for the governor and lieutenant governor will be counted and that no special election will be held for that race; and (3) a list of all candidates in the governor and lieutenant governor's race, listed in order of the base rotation. The listing of candidates shall include the name of the candidate to fill the vacancy in nomination for lieutenant governor. If the name of the candidate has not yet been named, then the list must include the date by which the candidate will be named. Subd. 7.Date of special election. If a special election is required under this section, the governor shall issue a writ calling for a special election to be conducted on the second Tuesday in February of the year following the year the vacancy in nomination occurred. Except where otherwise provided in this section, the writ shall be issued and the special election conducted according to the requirements of sections 204D.22 to 204D.27. Subd. 8.Absentee voters. At least 46 days, but no more than 50 days, before a special election conducted under this section, the county auditor shall transmit an absentee ballot for the special election to each applicant for an absentee ballot whose application for an absentee ballot for the preceding general election was recorded under section 203B.04 or 203B.17. New applicants for an absentee ballot may be provided a ballot in the manner specified in chapter 203B. Subd. 9.Appropriation. In the case of a statewide special election under this section, the amount necessary is appropriated to the secretary of state to cover costs incurred by the state, county, and municipal governments to conduct the special election. 1981 c 29 art 4 s 13; 1986 c 444; 1991 c 320 s 8-12; 2011 c 65 s 2,3; 2012 c 187 art 1 s 31; 2013 c 131 art 5 s 1-7; 2015 c 70 art 1 s 21-23; 2017 c 40 art 1 s 44,45 A vacancy in nomination for a nonpartisan office must be filled in the manner provided by this section. A vacancy in nomination for a nonpartisan office exists when: (1) a candidate for any nonpartisan office, for which one or two candidates filed, withdraws as provided in section 204B.12, subdivision 1; (2) a candidate for any nonpartisan office, for which one or two candidates filed, is determined to be ineligible to hold the office the candidate is seeking, pursuant to a court order issued under section 204B.44; or (3) a candidate for any nonjudicial nonpartisan office, for which only one or two candidates filed or who was nominated at a primary, dies on or before the 79th day before the date of the general election. Subd. 2.Procedure for filling vacancy. A vacancy in nomination for a nonpartisan office may be filled by filing an affidavit of candidacy and paying a filing fee, or by filing an affidavit of candidacy and filing a petition in place of a filing fee, in the manner provided in sections 204B.06, 204B.09, and 204B.11. All documents and fees required by this subdivision must be filed within five days after the vacancy in nomination occurs. There must be a two-day period for withdrawal of candidates after the last day for filing. If the vacancy in nomination resulted from a withdrawal during the withdrawal period held on the 68th to 69th day before the primary, and if, at the end of the withdrawal period to fill the vacancy in nomination, there are more than two candidates, the candidates' names must appear on the primary ballot. In all other cases, the candidates' names must appear on the general election ballot. 2013 c 131 art 5 s 8; 2015 c 70 art 1 s 24 Subdivision 1.Cities with wards. Except as provided in this subdivision, a city that elects its council members by wards may not redistrict those wards before the legislature has been redistricted. The wards must be redistricted within 60 days after the legislature has been redistricted or at least 19 weeks before the state primary election in the year ending in two, whichever is first. In a city of the first class electing council members by wards in a year ending in one, the ward boundaries may be reestablished no later than 14 days before the first day to file affidavits of candidacy for city council members. The ward boundaries may be modified after the legislature has been redistricted for the purpose of establishing precinct boundaries as provided in section 204B.14, subdivision 3. Subd. 2.Other election districts. For purposes of this subdivision, "local government election district" means a county district, park and recreation district, school district, or soil and water conservation district. Local government election districts, other than city wards covered by subdivision 1, may not be redistricted until precinct boundaries are reestablished under section 204B.14, subdivision 3, paragraph (c). Election districts covered by this subdivision must be redistricted within 80 days of the time when the legislature has been redistricted or at least 15 weeks before the state primary election in the year ending in two, whichever comes first. Subd. 3.Voters rights. (a) An eligible voter may apply to the district court for either a writ of mandamus requiring the redistricting of wards or local government election districts or to revise any plan adopted by the governing body responsible for redistricting of wards or local government election districts. (b) If a city adopts a ward redistricting plan at least 19 weeks before the primary in a year ending in two, an application for revision of the plan that seeks to affect elections held in the year ending in two must be filed with the district court within three weeks but no later than 18 weeks before the state primary election in the year ending in two, notwithstanding any charter provision. If a city adopts a ward redistricting plan less than 19 weeks before either the municipal primary in a year ending in one or before the state primary in a year ending in two, an application for revision of the plan that seeks to affect elections held in that year must be filed with the district court no later than one week after the plan has been adopted, notwithstanding any charter provision. (c) If a plan for redistricting of a local government election district is adopted at least 15 weeks before the state primary election in a year ending in two, an application for revision of the plan that seeks to affect elections held in the year ending in two must be filed with the district court within three weeks but no later than 14 weeks before the state primary election in the year ending in two. If a plan for redistricting of a local government election district is adopted less than 15 weeks before the state primary election in a year ending in two, an application for revision of the plan that seeks to affect elections held in the year ending in two must be filed with the district court no later than one week after the plan has been adopted. Subd. 4.Special elections; limitations. No municipality or school district may conduct a special election during the 19 weeks before the state primary election in the year ending in two. A school district special election required by any other law may be deferred until the date of the next school district general election, the state primary election, or the state general election. Subd. 5.Redistricting expenses. The county board may levy a tax not to exceed $1 per capita in the year ending in "0" to pay costs incurred in the year ending in "1" or "2" that are reasonably related to the redistricting of election districts, establishment of precinct boundaries, designation of polling places, and the updating of voter records in the statewide registration system. The county auditor shall distribute to each municipality in the county on a per capita basis 25 percent of the amount levied as provided in this subdivision, based on the population of the municipality in the most recent census. This levy is not subject to statutory levy limits. 1987 c 297 s 1; 1991 c 349 s 30; 1999 c 243 art 6 s 1; 2010 c 201 s 23; 2010 c 313 s 1,2; 2011 c 18 s 1 Subdivision 1.Boundaries. The governing body of each municipality shall establish the boundaries of the election precincts in the municipality. The governing body of a county shall establish the boundaries of precincts in unorganized territory in the county. Except as provided in subdivision 3, a governing body may change the boundaries of any election precinct which it has established. Subd. 1a.Legislative policy. It is the intention of the legislature to complete congressional and legislative redistricting activities in time to permit counties and municipalities to begin the process of reestablishing precinct boundaries as soon as possible after the adoption of the congressional and legislative redistricting plans but in no case later than 25 weeks before the state primary election in the year ending in two. Subd. 2.Separate precincts; combined polling place. (a) The following shall constitute at least one election precinct: (1) each city ward; and (2) each town and each statutory city. (b) A single, accessible, combined polling place may be established no later than November 1 if a presidential nomination primary is scheduled to occur in the following year or May 1 of any other year: (1) for any city of the third or fourth class, any town, or any city having territory in more than one county, in which all the voters of the city or town shall cast their ballots; (2) for contiguous precincts in the same municipality; (3) for up to four contiguous municipalities located entirely outside the metropolitan area, as defined by section 200.02, subdivision 24, that are contained in the same county; or (4) for noncontiguous precincts located in one or more counties. Subject to the requirements of paragraph (c), a single, accessible, combined polling place may be established after May 1 of any year in the event of an emergency. A copy of the ordinance or resolution establishing a combined polling place must be filed with the county auditor within 30 days after approval by the governing body. A polling place combined under clause (3) must be approved by the governing body of each participating municipality. A polling place combined under clause (4) must be approved by the governing body of each participating municipality and the secretary of state and may be located outside any of the noncontiguous precincts. A municipality withdrawing from participation in a combined polling place must do so by filing a resolution of withdrawal with the county auditor no later than October 1 if a presidential nomination primary is scheduled to occur in the following year or April 1 of any other year. The secretary of state shall provide a separate polling place roster for each precinct served by the combined polling place, except that in a precinct that uses electronic rosters the secretary of state shall provide separate data files for each precinct. A single set of election judges may be appointed to serve at a combined polling place. The number of election judges required must be based on the total number of persons voting at the last similar election in all precincts to be voting at the combined polling place. Separate ballot boxes must be provided for the ballots from each precinct. The results of the election must be reported separately for each precinct served by the combined polling place, except in a polling place established under clause (2) where one of the precincts has fewer than ten registered voters, in which case the results of that precinct must be reported in the manner specified by the secretary of state. (c) If a local elections official determines that an emergency situation preventing the safe, secure, and full operation of a polling place on election day has occurred or is imminent, the local elections official may combine two or more polling places for that election pursuant to this subdivision. To the extent possible, the polling places must be combined and the election conducted according to the requirements of paragraph (b), except that: (1) polling places may be combined after May 1 and until the polls close on election day; (2) any city or town, regardless of size or location, may establish a combined polling place under this paragraph; (3) the governing body is not required to adopt an ordinance or resolution to establish the combined polling place; (4) a polling place combined under paragraph (b), clause (3) or (4), must be approved by the local election official of each participating municipality; (5) the local elections official must immediately notify the county auditor and the secretary of state of the combination, including the reason for the emergency combination and the location of the combined polling place. As soon as possible, the local elections official must also post a notice stating the reason for the combination and the location of the combined polling place. The notice must also be posted on the governing board's website, if one exists. The local elections official must also notify the election judges and request that local media outlets publicly announce the reason for the combination and the location of the combined polling place; and (6) on election day, the local elections official must post a notice in large print in a conspicuous place at the polling place where the emergency occurred, if practical, stating the location of the combined polling place. The local election official must also post the notice, if practical, in a location visible by voters who vote from their motor vehicles as provided in section 204C.15, subdivision 2. If polling place hours are extended pursuant to section 204C.05, subdivision 2, paragraph (b), the posted notices required by this paragraph must include a statement that the polling place hours at the combined polling place will be extended until the specified time. Subd. 3.Boundary changes; prohibitions; exception. Notwithstanding other law or charter provisions to the contrary, during the period from January 1 in any year ending in zero to the time when the legislature has been redistricted in a year ending in one or two, no changes may be made in the boundaries of any election precinct except as provided in this subdivision. (a) If a city annexes an unincorporated area located in the same county as the city and adjacent to the corporate boundary, the annexed area may be included in an election precinct immediately adjacent to it. (b) A municipality or county may establish new election precincts lying entirely within the boundaries of any existing precinct and shall assign names to the new precincts which include the name of the former precinct. (c) Precinct boundaries in a city of the first class electing council members by wards may be reestablished within four weeks of the adoption of ward boundaries in a year ending in one, as provided in section 204B.135, subdivision 1. (d) Precinct boundaries must be reestablished within 60 days of the time when the legislature has been redistricted, or at least 19 weeks before the state primary election in a year ending in two, whichever comes first. The adoption of reestablished precinct boundaries becomes effective on the date of the state primary election in the year ending in two. Precincts must be arranged so that no precinct lies in more than one legislative or congressional district. Subd. 4.Boundary change procedure. Any change in the boundary of an election precinct must be adopted at least ten weeks before the date of the next election and, for the state primary and general election or presidential nomination primary, no later than December 1 in the year prior to the year of the state general election. The precinct boundary change shall not take effect until notice of the change has been posted in the office of the municipal clerk or county auditor for at least 56 days. The county auditor must publish a notice illustrating or describing the congressional, legislative, and county commissioner district boundaries in the county in one or more qualified newspapers in the county at least 14 days before the first day to file affidavits of candidacy for the state general election in the year ending in two. Alternate dates for adopting changes in precinct boundaries, posting notices of boundary changes, and notifying voters affected by boundary changes pursuant to this subdivision, and procedures for coordinating precinct boundary changes with reestablishing local government election district boundaries may be established in the manner provided in the rules of the secretary of state. Subd. 4a.Municipal boundary adjustment procedure. A change in the boundary of an election precinct that has occurred as a result of a municipal boundary adjustment made under chapter 414 that is effective more than 21 days before a regularly scheduled election takes effect at the scheduled election. A change in the boundary of an election precinct that has occurred as a result of a municipal boundary adjustment made under chapter 414 that is effective less than 21 days before a regularly scheduled election takes effect the day after the scheduled election. Subd. 5.Precinct boundaries; description; maps. If a precinct boundary has been changed or an annexation has occurred affecting a precinct boundary, the municipal clerk shall immediately notify the county auditor and secretary of state. The municipal clerk shall file a corrected base map with the secretary of state and county auditor within 30 days after the boundary change was made or, in the case of an annexation, the later of: (1) 30 days after the approval of the annexation order; or (2) the effective date of the annexation order. Upon request, the county auditor shall provide a base map and precinct finder to the municipal clerk. The municipal clerk shall prepare a corrected precinct map and provide the corrected map to the county auditor, who shall correct the precinct finder in the statewide voter registration system and make the corrected map and precinct finder available for public inspection, and to the secretary of state, who shall update the precinct boundary database. The county auditor shall prepare and file precinct boundary maps for precincts in unorganized territories in the same manner as provided for precincts in municipalities. For every election held in the municipality the election judges shall be furnished precinct maps as provided in section 201.061, subdivision 6. If a municipality changes the boundary of an election precinct, or if an annexation affecting a precinct boundary occurs, the county auditor shall notify each school district with territory affected by the boundary change at least 30 days before the effective date of the change. [Repealed, 2015 c 70 art 1 s 63] Subd. 7.Application to municipalities. Notwithstanding the provisions of section 410.21, or any other law, ordinance or charter to the contrary, the provisions of subdivisions 1 and 3 apply to all municipalities. [Repealed, 1994 c 607 s 7] 1981 c 29 art 4 s 14; 1Sp1981 c 4 art 4 s 43; 2Sp1981 c 2 s 2; 1983 c 289 s 115 subd 1; 1985 c 248 s 36; 1986 c 444; 1987 c 186 s 15; 1987 c 212 s 1-4; 1987 c 297 s 2; 1990 c 453 s 4; 1991 c 349 s 31-34; 1993 c 208 s 1,2; 1993 c 223 s 9; 1994 c 607 s 1-4; 1999 c 237 s 1; 2000 c 467 s 13-15; 2005 c 156 art 6 s 34; 2005 c 162 s 2; 2006 c 270 art 1 s 1; 2010 c 184 s 13,14; 2010 c 201 s 24; 2010 c 313 s 3,4; 2011 c 18 s 2,3; 2014 c 288 art 2 s 4; 2016 c 161 art 1 s 5; art 3 s 1; 2016 c 162 s 4,5 Following the completion of legislative redistricting, the secretary of state may coordinate and facilitate the exchange of information between the legislative redistricting computer system, the statewide voter registration system, and a computer system developed to assist the counties, municipalities, and school districts in redrawing election districts and establishing election precincts. 1991 c 345 art 1 s 80 Subdivision 1.Redistricting. The secretary of state shall conduct conferences with the county auditors, municipal clerks, and school district clerks to instruct them on the procedures for redistricting of election districts and establishment of election precincts in the year ending in one. Subd. 2.Precinct and election district boundaries. The secretary of state shall maintain a computer database of precinct and election district boundaries. The secretary of state shall revise the information in the database whenever a precinct or election district boundary is changed. The secretary of state shall prepare maps illustrating precinct and election district boundaries in either paper or electronic formats and make them available to the public at the cost of production. The secretary of state may authorize municipalities and counties to provide updated precinct and election district boundary information in electronic formats. The secretary of state shall provide periodic updates of precinct and election district boundaries to the Legislative Coordinating Commission, the state demographer, and the Minnesota Geospatial Information Office. At the request of the county auditor, the secretary of state shall provide the county auditor with precinct maps. The county auditor shall forward the maps to the appropriate municipal clerks, who shall post the map in the polling place on the day of the state primary and the state general election. Subd. 3.Correction to election district boundaries. When a municipal boundary has changed and is coterminous with (1) a congressional, legislative, or county commissioner district boundary, or (2) a soil and water conservation district supervisor district boundary elected by district under section 103C.311, subdivision 2, and the affected territory contains 50 or fewer registered voters, the secretary of state may order corrections to move the affected election district boundaries so the boundaries are again coterminous with the municipal boundary. The election district boundary change is effective 28 days after the date that the order is issued. The secretary of state shall immediately notify the municipal clerk and county auditor affected by the boundary change and the Legislative Coordinating Commission. The municipal clerk shall send a nonforwardable notice stating the location of the polling place to every household containing a registered voter affected by the boundary change at least 25 days before the next election. 1991 c 349 s 35; 1993 c 208 s 3; 1997 c 147 s 27; 1999 c 132 s 18; 1999 c 237 s 2; 2009 c 101 art 2 s 107; 2016 c 161 art 1 s 6 A county board may establish new election precincts to serve the residents of unorganized territories. The board shall designate a polling place for the new precinct that is convenient for the individuals residing in it. 1981 c 29 art 4 s 15; 1997 c 147 s 28 Subdivision 1.Authority; location. By December 31 of each year, the governing body of each municipality and of each county with precincts in unorganized territory must designate by ordinance or resolution a polling place for each election precinct. The polling places designated in the ordinance or resolution are the polling places for the following calendar year, unless a change is made: (1) pursuant to section 204B.175; (2) because a polling place has become unavailable; or (3) because a township designates one location for all state and federal elections and one location for all township only elections. Polling places must be designated and ballots must be distributed so that no one is required to go to more than one polling place to vote in a school district and municipal election held on the same day. The polling place for a precinct in a city or in a school district located in whole or in part in the metropolitan area defined by section 200.02, subdivision 24, shall be located within the boundaries of the precinct or within one mile of one of those boundaries unless a single polling place is designated for a city pursuant to section 204B.14, subdivision 2, or a school district pursuant to section 205A.11. The polling place for a precinct in unorganized territory may be located outside the precinct at a place which is convenient to the voters of the precinct. If no suitable place is available within a town or within a school district located outside the metropolitan area defined by section 200.02, subdivision 24, then the polling place for a town or school district may be located outside the town or school district within five miles of one of the boundaries of the town or school district. Subd. 1a.Notice to voters. If the location of a polling place has been changed, the governing body establishing the polling place shall send to every affected household with at least one registered voter in the precinct a nonforwardable mailed notice stating the location of the new polling place at least 25 days before the next election. The secretary of state shall prepare a sample of this notice. A notice that is returned as undeliverable must be forwarded immediately to the county auditor. This subdivision does not apply to a polling place location that is changed on election day under section 204B.175. Subd. 3.Designation effective until changed. The designation of a polling place pursuant to this section shall remain effective until a different polling place is designated for that precinct. No designation of a new or different polling place shall become effective less than 90 days prior to an election, including school district elections or referenda, and no polling place changes may occur during the period between the state primary and the state general election, except that a new polling place may be designated to replace a polling place that has become unavailable for use. Subd. 4.Prohibited locations. No polling place shall be designated in any place where intoxicating liquors or nonintoxicating malt beverages are served or in any adjoining room. No polling place shall be designated in any place in which substantial compliance with the requirements of this chapter cannot be attained. Subd. 5.Access by elderly and persons with disabilities. Each polling place shall be accessible to and usable by elderly individuals and individuals with disabilities. A polling place is deemed to be accessible and usable if it complies with the standards in paragraphs (a) to (f). (a) At least one set of doors must have a minimum width of 32 inches if the doors must be used to enter or leave the polling place. (b) Any curb adjacent to the main entrance to a polling place must have curb cuts or temporary ramps. Where the main entrance is not the accessible entrance, any curb adjacent to the accessible entrance must also have curb cuts or temporary ramps. (c) Where the main entrance is not the accessible entrance, a sign shall be posted at the main entrance giving directions to the accessible entrance. (d) At least one set of stairs must have a temporary handrail and ramp if stairs must be used to enter or leave the polling place. (e) No barrier in the polling place may impede the path of persons with disabilities to the voting booth. (f) At least one parking space for persons with disabilities, which may be temporarily so designated by the municipality for the day of the election, must be available near the accessible entrance. The doorway, handrails, ramps, and disabled parking provided pursuant to this subdivision must conform to the standards specified in the State Building Code for accessibility by persons with disabilities. A governing body shall designate as polling places only those places which meet the standards prescribed in this subdivision unless no available place within a precinct is accessible or can be made accessible. Subd. 6.Public facilities. Every statutory city, home rule charter city, county, town, school district, and other public agency, including the University of Minnesota and other public colleges and universities, shall make their facilities, including parking, available for the holding of city, county, school district, state, and federal elections, subject to the approval of the local election official. A charge for the use of the facilities may be imposed in an amount that does not exceed the lowest amount charged to any public or private group. Subd. 7.Appropriate facilities. The facilities provided in accordance with subdivision 6 shall be sufficient in size to accommodate all election activities and the requirements of subdivision 5. The space must be separated from other activities within the building. The local election official may approve space in two connecting rooms for registration and balloting activities. Except in the event of an emergency making the approved space unusable, the public facility may not move the election from the space approved by the local election official without prior approval. In addition to the requirements of subdivision 5, the public facility must make remaining parking spaces not in use for regularly scheduled activities available for voters. 1981 c 29 art 4 s 16; 1983 c 124 s 4; 1984 c 471 s 5; 1985 c 307 s 1; 1987 c 266 art 1 s 25; 1991 c 227 s 12,13; 1991 c 349 s 36,37; 1992 c 474 s 1; 1993 c 223 s 10; 1997 c 147 s 29,30; 2000 c 467 s 16; 2004 c 293 art 2 s 18; 2005 c 56 s 1; 2005 c 156 art 6 s 35,36; 2008 c 244 art 1 s 11; 2017 c 92 art 1 s 14; art 2 s 8 Subdivision 1.Application. When an emergency occurs after the deadline to designate a polling place pursuant to section 204B.16 but before the polls close on election day, a new polling place may be designated for that election pursuant to this section. For purposes of this section, an emergency is any situation that prevents the safe, secure, and full operation of a polling place. Subd. 2.Changing polling place. If a local election official determines that an emergency has occurred or is imminent, the local election official must procure a polling place that is as near the designated polling place as possible and that complies with the requirements of section 204B.16, subdivisions 4 and 5. If it is not possible to locate a new polling place in the precinct, the polling place may be located outside of the precinct without regard to the distance limitations in section 204B.16, subdivision 1. The local election official must certify to the appropriate governing body the expenses incurred because of the change. These expenses shall be paid as part of the expenses of the election. Subd. 3.Notice. (a) Upon making the determination to relocate a polling place, the local election official must immediately notify the county auditor and the secretary of state. The notice must include the reason for the relocation and the reason for the location of the new polling place. As soon as possible, the local election official must also post a notice stating the reason for the relocation and the location of the new polling place. The notice must also be posted on the website of the public body, if there is one. The local election official must also notify the election judges and request that local media outlets publicly announce the reason for the relocation and the location of the polling place. (b) On election day, the local election official must post a notice in large print in a conspicuous place at the polling place where the emergency occurred, if practical, stating the location of the new polling place. The local election official must also post the notice, if practical, in a location visible by voters who vote from their motor vehicles as provided in section 204C.15, subdivision 2. If polling place hours are extended pursuant to section 204C.05, subdivision 2, paragraph (b), the posted notices required by this paragraph must include a statement that the polling place hours at the new polling place will be extended until the specified time. 2016 c 161 art 3 s 2 Subdivision 1.Booths; voting stations. (a) Each polling place must contain a number of voting booths or voting stations in proportion to the number of individuals eligible to vote in the precinct. The booth or station shall permit the voter to vote privately and independently. (b) Each polling place must have at least one accessible voting booth or other accessible voting station and beginning with federal and state elections held after December 31, 2005, and county, municipal, and school district elections held after December 31, 2007, one voting system that conforms to section 301(a)(3)(B) of the Help America Vote Act, Public Law 107-252. (c) Local jurisdictions must make accessible voting stations purchased with funds provided from the Help America Vote Act account available to other local jurisdictions holding stand-alone elections. The jurisdiction providing the equipment may require the jurisdiction using the equipment to reimburse any direct actual costs incurred as a result of the equipment's use and any prorated indirect costs of maintaining and storing the equipment. A rental or other similar use fee may not be charged. Any funds received under this paragraph for expenses incurred by that local jurisdiction as a direct result of making the equipment available that were not paid for in whole or in part with funds from the Help America Vote Act account are not program income under the Help America Vote Act, Public Law 107-252. Any funds received by a local jurisdiction making the equipment available as reimbursement for expenses as defined as "operating costs" under Laws 2005, chapter 162, section 34, subdivision 1, paragraph (b), and paid for in whole or in part with funds from the Help America Vote Act account must be treated as program income and deposited into the jurisdiction's Help America Vote Act account in the direct proportion that funds from the Help America Vote Act account were used to pay for those "operating costs." (d) All booths or stations must be constructed so that a voter is free from observation while marking ballots. During the hours of voting, the booths or stations must have instructions, a pencil, and other supplies needed to mark the ballots. A chair must be provided for elderly voters and voters with disabilities to use while voting or waiting to vote. Stable flat writing surfaces must also be made available to voters who are completing election-related forms. (e) All ballot boxes, voting booths, voting stations, and election judges must be in open public view in the polling place. Subd. 2.Ballot boxes. Each box shall be of sufficient size and shall have a sufficient opening to receive and contain all the ballots likely to be deposited in it. 1981 c 29 art 4 s 18; 1984 c 471 s 7; 1987 c 266 art 1 s 26; 2000 c 467 s 17; 2005 c 156 art 6 s 37; 2010 c 201 s 25; 2013 c 131 art 2 s 22; 2016 c 161 art 1 s 7 Subdivision 1.State elections emergency plans. (a) The secretary of state, in consultation with the Minnesota director of the Department of Public Safety, Division of Homeland Security and Emergency Management, must develop a state elections emergency plan. (b) The secretary of state must also coordinate with the governor to incorporate election needs into the state's continuity of government and continuity of operations plans. (c) The secretary of state must create a state guide to assist county and local election officials in developing a county elections emergency plan required by subdivision 2. The secretary of state must consult with the Minnesota State Council on Disability in developing the guide. The guide must include a model county elections emergency plan that meets the requirements of this section. Subd. 2.County elections emergency plans. (a) County election officials, in consultation with the political subdivision's local organization for emergency management established under section 12.25 and the municipalities and school districts within the county, must develop a county elections emergency plan to be made available for use in all state, county, municipal, and school district elections held in that county. (b) In developing the county elections emergency plan, the county must address the needs of voters with disabilities in all aspects of the plan. Where ballot security is affected, the plan must provide procedures to maintain the security of the ballots. When an emergency requires the relocation of the polling place, the plan must include procedures for securing the ballots and voting equipment, notifying the public and other government officials, and restoring voting activities as soon as possible. If the county contains jurisdictions that cross county lines, the affected counties must make efforts to ensure that the emergency procedures affecting the local jurisdiction are uniform throughout the jurisdiction. (c) Cities, towns, and school districts may create a local elections emergency plan that meets the requirements of the county elections emergency plan. If a local jurisdiction creates a local elections emergency plan, the procedures within the local elections emergency plan govern in all election emergencies within that local jurisdiction. (d) County election officials and any municipality with a local elections emergency plan must review their county or local elections emergency plan prior to each state general election. Any revisions to the county or local elections emergency plan must be completed and filed with the secretary of state by July 1 prior to the state general election. Subdivision 1.Individuals qualified to be election judges. Except as provided in subdivision 6, any individual who is eligible to vote in this state is qualified to be appointed as an election judge. Subd. 2.Individuals not qualified to be election judges. (a) Except as provided in paragraph (b), no individual shall be appointed as an election judge for any precinct if that individual: (1) is unable to read, write, or speak the English language; (2) is the spouse; parent, including a stepparent; child, including a stepchild; or sibling, including a stepsibling; of any election judge serving in the same precinct or of any candidate at that election; (3) is domiciled, either permanently or temporarily, with any candidate on the ballot at that election; or (4) is a candidate at that election. (b) Individuals who are related to each other as provided in paragraph (a), clause (2), may serve as election judges in the same precinct, provided that they serve on separate shifts that do not run concurrently. Subd. 4.Additional qualifications permitted; examination. The appointing authority may establish additional qualifications which are not inconsistent with the provisions of this section and which relate to the ability of an individual to perform the duties of an election judge. The appointing authority may examine any individual who seeks appointment as an election judge to determine whether the individual meets any qualification established under this section. Subd. 5.Party balance requirement. No more than half of the election judges in a precinct may be members of the same major political party unless the election board consists of an odd number of election judges, in which case the number of election judges who are members of the same major political party may be one more than half the number of election judges in that precinct. Subd. 6.High school students. Notwithstanding any other requirements of this section, a student enrolled in a high school in Minnesota or who is in a home school in compliance with sections 120A.22 and 120A.24, who has attained the age of 16 is eligible to be appointed as a without party affiliation trainee election judge in the county in which the student resides, or a county adjacent to the county in which the student resides. The student must meet qualifications for trainee election judges specified in rules of the secretary of state. A student appointed as a trainee election judge may be excused from school attendance during the hours that the student is serving as a trainee election judge if the student submits a written request signed and approved by the student's parent or guardian to be absent from school and a certificate from the appointing authority stating the hours during which the student will serve as a trainee election judge to the principal of the school at least ten days prior to the election. Students shall not serve as trainee election judges after 10:00 p.m. Notwithstanding section 177.24 to the contrary, trainee election judges may be paid not less than two-thirds of the minimum wage for a large employer. The principal of the school may approve a request to be absent from school conditioned on acceptable academic performance at the time of service as a trainee election judge. 1981 c 29 art 4 s 19; 1983 c 126 s 1; 1983 c 303 s 7; 1985 c 39 s 1; 1987 c 266 art 1 s 27; 1991 c 237 s 1,2; 1995 c 34 s 1; 2000 c 467 s 18; 2004 c 293 art 2 s 19,20; 2010 c 180 s 1; 2014 c 264 s 15; 2015 c 70 art 1 s 25,26 An individual who is selected to serve as an election judge pursuant to section 204B.21, subdivision 2 may, after giving an employer at least 20 days' written notice, be absent from a place of work for the purpose of serving as an election judge without penalty. An employer may reduce the salary or wages of an employee serving as an election judge by the amount paid to the election judge by the appointing authority during the time the employee was absent from the place of employment. The written request to be absent from work must be accompanied by a certification from the appointing authority stating the hourly compensation to be paid the employee for service as an election judge and the hours during which the employee will serve. An employer may restrict the number of persons to be absent from work for the purpose of serving as an election judge to no more than 20 percent of the total work force at any single worksite. 1983 c 126 s 2; 1986 c 444; 1991 c 237 s 3 The election judges appointed to serve in an election precinct shall constitute the election board for that precinct. The appointing authority shall designate one of the election judges in each precinct to serve as the head election judge. The head election judge shall assign specific duties to the election judges of that precinct as necessary or convenient to complete forms, obtain signatures, and perform all the other duties required of election judges. 1981 c 29 art 4 s 20; 1986 c 444; 1Sp2001 c 10 art 18 s 20 Subdivision 1.Appointment lists; duties of political parties and secretary of state. On May 1 in a year in which there is an election for a partisan political office, each major political party shall prepare a list of eligible voters to act as election judges in each election precinct. The list provided by the party must indicate which eligible voters are willing to travel to a precinct outside of their home jurisdiction to act as an election judge, and the jurisdictions to which each eligible voter is willing to travel for that purpose. The political parties shall furnish the lists electronically to the secretary of state, in a format specified by the secretary of state. The secretary of state must combine the data received from each political party under this subdivision and must process the data to locate the precinct in which the address provided for each potential election judge is located. If the data submitted by a political party is insufficient for the secretary of state to locate the proper precinct, the associated name must not appear in any list forwarded to an appointing authority under this subdivision. The secretary of state shall notify political parties of any proposed election judges with addresses that could not be located in a precinct. By May 15, the secretary of state shall furnish electronically to the county auditor a list of the appropriate names for each election precinct in the jurisdiction of the appointing authority, and a list of the names of individuals residing outside of the jurisdiction who indicated a willingness to travel to that jurisdiction to act as an election judge, noting the political party affiliation of each individual on the list. The county auditor must promptly forward the appropriate names to the appropriate municipal clerk. Subd. 2.Appointing authority; powers and duties. Election judges for precincts in a municipality shall be appointed by the governing body of the municipality. Election judges for precincts in unorganized territory and for performing election-related duties assigned by the county auditor shall be appointed by the county board. Election judges for a precinct composed of two or more municipalities must be appointed by the governing body of the municipality or municipalities responsible for appointing election judges as provided in the agreement to combine for election purposes. Except as otherwise provided in this section, appointments shall be made from the list of voters who reside in each precinct, furnished pursuant to subdivision 1, subject to the eligibility requirements and other qualifications established or authorized under section 204B.19. At least two election judges in each precinct must be affiliated with different major political parties. If no lists have been furnished or if additional election judges are required after all listed names in that municipality have been exhausted, the appointing authority may appoint other individuals who meet the qualifications to serve as an election judge, including persons on the list furnished pursuant to subdivision 1 who indicated a willingness to travel to the municipality, and persons who are not affiliated with a major political party. An individual who is appointed from a source other than the list furnished pursuant to subdivision 1 must provide to the appointing authority the individual's major political party affiliation or a statement that the individual does not affiliate with any major political party. An individual who refuses to provide the individual's major political party affiliation or a statement that the individual does not affiliate with a major political party must not be appointed as an election judge. The appointments shall be made at least 25 days before the election at which the election judges will serve, except that the appointing authority may pass a resolution authorizing the appointment of additional election judges within the 25 days before the election if the appointing authority determines that additional election judges will be required. Subd. 3.Access to election judge party affiliation. Notwithstanding section 13.43, the major political party affiliation of an election judge or a statement that the judge does not affiliate with a major political party may be shared with other election judges assigned to the precinct at the same election, to verify compliance with party balance requirements. This data may not be disclosed or used by the election judges for any other purpose. 1981 c 29 art 4 s 21; 1983 c 303 s 8; 1986 c 444; 1987 c 212 s 5; 1999 c 132 s 19; 2008 c 295 s 11,12; 2010 c 180 s 2,3; 2010 c 184 s 15; 2017 c 92 art 1 s 15 Subdivision 1.Minimum number required. (a) A minimum of four election judges shall be appointed for each precinct in the state general election, provided that a minimum of three election judges shall be appointed for each precinct with fewer than 500 registered voters as of 14 weeks before the state primary. In all other elections, a minimum of three election judges shall be appointed for each precinct. In a combined polling place under section 204B.14, subdivision 2, at least one judge must be appointed from each municipality in the combined polling place, provided that not less than three judges shall be appointed for each combined polling place. The appointing authorities may appoint election judges for any precinct in addition to the number required by this subdivision including additional election judges to count ballots after voting has ended. (b) An election judge may serve for all or part of election day, at the discretion of the appointing authority, as long as the minimum number of judges required is always present. The head election judge designated under section 204B.20 must serve for all of election day and be present in the polling place unless another election judge has been designated by the head election judge to perform the functions of the head election judge during any absence. Subd. 4.Election judge trainees not counted toward minimum number of election judges. The presence or participation of election judge trainees must not be counted toward satisfying any of the required numbers of election judges in this chapter. 1981 c 29 art 4 s 22; 1986 c 362 s 3; 1987 c 212 s 6; 1994 c 607 s 5; 1997 c 147 s 31; 1Sp2001 c 10 art 18 s 21,22; 2004 c 293 art 2 s 21; 2010 c 201 s 26,27; 2013 c 131 art 2 s 23 A vacancy on an election board occurs when any election judge who is a member of that board: (a) fails to arrive at the polling place within 30 minutes after the time when the polling place is scheduled to open; (b) becomes unable to perform the duties of the office after assuming those duties; or (c) for any reason fails or refuses to perform the duties of the office as assigned by the head election judge. When a vacancy occurs, the remaining election judges of the precinct shall elect an individual to fill the vacancy subject to the provisions of section 204B.19. When possible the election judges shall elect individuals who have been trained as election judges pursuant to section 204B.25. The oath signed by the new election judge shall indicate that the new election judge was elected to fill a vacancy. The municipal clerk may assign election judges to fill vacancies as they occur. 1981 c 29 art 4 s 23; 1986 c 444; 1997 c 147 s 32; 1Sp2001 c 10 art 18 s 23 Each election judge shall sign the following oath before assuming the duties of the office: "I .......... solemnly swear (or affirm) that I will perform the duties of election judge according to law and the best of my ability and will diligently endeavor to prevent fraud, deceit and abuse in conducting this election. I will perform my duties in a fair and impartial manner and not attempt to create an advantage for my party or for any candidate." The oath shall be attached to the summary statement of the election returns of that precinct. If there is no individual present who is authorized to administer oaths, the election judges may administer the oath to each other. 1981 c 29 art 4 s 24; 2005 c 156 art 6 s 38; 2010 c 201 s 28 Subdivision 1.Duties of county auditor. Each county auditor shall provide training for all election judges who are appointed to serve at any election to be held in the county. The county auditor shall also provide a procedure for emergency training of election judges elected to fill vacancies. The county auditor may delegate to a municipal election official the duty to provide training of election judges in that municipality or school district. Subd. 2.Rules of secretary of state. The secretary of state shall adopt rules establishing programs for the training of county auditors, local election officials, and election judges by county auditors as required by this section. Subd. 3.Trained election judges; number required. Each election precinct in which less than 100 individuals voted at the last state general election shall have at least two election judges who are members of different major political parties who have received training as required in this section. In every other election precinct, no individual may serve as an election judge who has not received training as required by subdivision 1. Subd. 4.Training for local election officials. At least once every two years, the county auditor shall conduct training sessions for the municipal and school district clerks in the county. The training sessions must be conducted in the manner provided by the secretary of state. No local election official may administer an election without receiving training from the county auditor. 1981 c 29 art 4 s 25; 1987 c 266 art 1 s 28; 1999 c 250 art 1 s 86,87 Any individual who serves as an election judge in violation of any of the provisions of sections 204B.19 to 204B.25, is guilty of a misdemeanor. 1981 c 29 art 4 s 26 Subdivision 1.Blank forms. At least 14 days before every state election the secretary of state shall transmit to each county auditor examples of any blank forms to be used as the secretary of state deems necessary for the conduct of the election. County abstract forms may be provided to auditors electronically via the Minnesota State Election Reporting System maintained by the secretary of state, and must be available at least one week prior to the election. Subd. 2.Election law and instructions. The secretary of state shall prepare and publish a volume containing all state general laws relating to elections. The attorney general shall provide annotations to the secretary of state for this volume. On or before August 1 of every odd-numbered year the secretary of state shall furnish to the county auditors and municipal clerks enough copies of this volume so that each county auditor and municipal clerk will have at least one copy. On or before July 1 of every even-numbered year, the secretary of state shall prepare and make an electronic copy available on the office's website. The secretary of state may prepare and transmit to the county auditors and municipal clerks detailed written instructions for complying with election laws relating to the conduct of elections, conduct of voter registration and voting procedures. Subd. 3.Instruction posters. At least 25 days before every state primary election, the secretary of state shall prepare and furnish to the county auditor of each county voter instruction posters printed in large type upon cards or heavy paper. The instruction posters must contain the information needed to enable the voters to cast their paper ballots quickly and correctly and indicate the types of assistance available for elderly and disabled voters. Two instruction posters shall be furnished for each precinct. Upon mutual agreement, the secretary of state may provide the posters in an electronic format. Subd. 4.Pamphlets. The secretary of state shall prepare and distribute to election officials pamphlets for voters containing impartial instructions relating to voter registration and election procedures. The pamphlets must indicate the types of registration and voting assistance available for elderly and disabled individuals and residents of health care facilities and hospitals. Subd. 5.Conferences for county auditors. Before each state primary the secretary of state shall conduct conferences with county auditors to instruct them on the administration of election laws and the training of local election officials and election judges. Subd. 6.Voter participation. The secretary of state may sponsor or participate in nonpartisan activities to promote voter participation in Minnesota elections and in efforts to increase voter registration and voter turnout. Subd. 7.Educational activities. The secretary of state may authorize educational activities related to voting and elections for elementary or secondary school students in the polling place on the day of a state, county, municipal, or school district election. Ballots used for educational activities must be a different color than any ballot used at the election. Activities authorized under this subdivision must be administered in a manner that does not interfere with the conduct of the election. Subd. 8.Voter information telephone line. The secretary of state shall provide a voter information telephone line. A toll-free number must be provided for use by persons residing outside the metropolitan calling area. The secretary of state shall make available information concerning voter registration, absentee voting, election results, and other election-related information considered by the secretary of state to be useful to the public. Subd. 9.Election supply contract. The secretary of state may enter into a statewide contract from which any county auditor may purchase ballots, forms, or other election supplies. Subd. 10.Training for county auditors; training materials. The secretary of state shall develop a training program in election administration for county auditors and shall certify each county auditor who successfully completes the training program. The secretary of state shall provide each county auditor with materials for use in training local election officials and election judges. Subd. 11.Translation of voting instructions. The secretary of state may develop voting instructions in languages other than English, to be posted and made available in polling places during elections. The state demographer shall determine and report to the secretary of state the languages that are so common in this state that there is a need for translated voting instructions. 1981 c 29 art 4 s 27; 1983 c 303 s 9; 1984 c 471 s 8,9; 1984 c 560 s 10,11; 1987 c 175 s 6; 1989 c 291 art 1 s 9; 1991 c 237 s 4; 1992 c 513 art 3 s 43; 1994 c 632 art 3 s 54; 1997 c 147 s 33; 1999 c 132 s 20; 1999 c 250 art 1 s 88; 1Sp2001 c 10 art 18 s 24; 2005 c 56 s 1; 2005 c 156 art 6 s 39; 2010 c 201 s 29,30 Subdivision 1.Meeting with election officials. At least 12 weeks before each regularly scheduled town general election conducted in March, and at least 18 weeks before all other general elections, each county auditor shall conduct a meeting or otherwise communicate with local election officials to review the procedures for the election. The county auditor may require the head election judges in the county to attend this meeting. Subd. 2.Election supplies; duties of county auditors and clerks. Except as otherwise provided for absentee ballots in section 204B.35, subdivision 4, the county auditor shall complete the preparation of the election materials for which the auditor is responsible at least four days before every state primary and state general election. At any time after all election materials are available from the county auditor but not later than four days before the election each municipal clerk shall secure from the county auditor: (a) the forms that are required for the conduct of the election; (b) any printed voter instruction materials furnished by the secretary of state; (c) any other instructions for election officers; and (d) a sufficient quantity of the official ballots, registration files, envelopes for ballot returns, and other supplies and materials required for each precinct in order to comply with the provisions of the Minnesota Election Law. The county auditor may furnish the election supplies to the municipal clerks in the same manner as the supplies are furnished to precincts in unorganized territory pursuant to section 204B.29, subdivision 1. Subd. 3.Certification of number. The county auditor or municipal clerk must certify the number of ballots being provided to each precinct and provide this number to the election judges for inclusion on the summary statement. The auditor or clerk must not open prepackaged ballots, but must count the ballots, presuming that the total count for each package is correct. 1981 c 29 art 4 s 28; 1981 c 217 s 5; 1984 c 560 s 12; 1986 c 444; 1990 c 585 s 25; 1999 c 250 art 1 s 89; 1Sp2001 c 10 art 18 s 25; 2010 c 201 s 31; 2013 c 131 art 2 s 24 Subdivision 1.Securing election materials. Before 9:00 p.m. on the day preceding an election, at least one election judge from each precinct in each municipality, or school district if applicable, shall secure voter registration files, ballots, forms, envelopes and other required supplies from the municipal clerk, school district clerk, or other legal custodian. The election judge shall deliver the materials to the polling place before the time when voting is scheduled to begin on election day. The county auditor shall send or deliver the election supplies enumerated in this section to the election judges in the precincts in unorganized territory. The election supplies may be sent by certified mail, parcel post, express mail or any other postal service providing assured delivery by no later than the day before the election. If the election supplies are delivered by any other means, they shall be delivered by no later than the day before the election. Each precinct shall be furnished with 100 ballots of each kind for every 85 individuals who voted in that precinct at the last election for the same office or on similar questions, or with ballots of each kind in an amount at least ten percent greater than the number of votes which are reasonably expected to be cast in that precinct in that election, whichever supply of ballots is greater. No precinct shall be furnished with any ballots containing the name of any candidate who cannot properly be voted for in that precinct. The election judges shall be responsible for the preservation of all election materials received by them until returned to the appropriate election officials after the voting has ended. Subd. 2.Failure of election judges to secure materials. If no election judge secures the election materials for a precinct in any municipality, or school district if applicable, as provided in subdivision 1, the municipal or school district clerk shall deliver them to an election judge for that precinct not later than the time when voting is scheduled to begin. The municipal or school district clerk shall require the election judge accepting delivery of the election supplies to sign a receipt for them. The election judges of that precinct shall pay the expenses of delivery of the materials and shall be liable for the penalty provided by law for neglect of duty. 1981 c 29 art 4 s 29; 1984 c 560 s 13; 1987 c 266 art 1 s 29 When no official or substitute ballots are ready at the time when voting is scheduled to begin or if the supply is exhausted before the voting ends, the election judges shall contact the municipal clerk and, at the clerk's direction, shall prepare unofficial ballots, printed or written as nearly as practicable in the form of the official ballots, which ballots may be used until official or substitute ballots are available. When unofficial ballots are prepared and used in any precinct, the election judges shall note that fact on the summary statement of the returns for that precinct and specify the number of unofficial ballots that were cast. 1981 c 29 art 4 s 30; 1986 c 444 Subdivision 1.Compensation. The compensation for services performed under the Minnesota Election Law shall be as follows: (1) to presidential electors from funds appropriated to the secretary of state for this purpose, $35 for each day of attendance at the Capitol and mileage for travel to and from the Capitol in the amount allowed for state employees in accordance with section 43A.18, subdivision 2; (2) to individuals, other than county, city, school district, or town employees during their normal workday, who are appointed by the county auditor to carry ballots to or from the county auditor's office, a sum not less than the prevailing Minnesota minimum wage for each hour spent in carrying ballots and mileage in the amount allowed pursuant to section 471.665, subdivision 1; (3) to members of county canvassing boards, a sum not less than the prevailing Minnesota minimum wage for each hour necessarily spent and an amount for each mile of necessary travel equal to the amount allowed pursuant to section 471.665, subdivision 1; (4) to election judges serving in any city, an amount fixed by the governing body of the city; to election judges serving in any school district election which is not held in conjunction with a state election, an amount fixed by the school board of the school district; to election judges serving in unorganized territory, an amount fixed by the county board; and to election judges serving in towns, an amount fixed by the town board. Election judges shall receive at least the prevailing Minnesota minimum wage for each hour spent carrying out their duties at the polling places and in attending training sessions required by section 204B.25, except as provided in subdivision 2. An election judge who travels to pick up election supplies or to deliver election returns to the county auditor shall receive, in addition to other compensation authorized by this section, a sum not less than the prevailing Minnesota minimum wage for each hour spent performing these duties, plus mileage in the same amount as allowed pursuant to section 471.665, subdivision 1; and (5) to sergeants at arms, an amount for each hour of service performed at the direction of the election judges, fixed in the same manner as compensation for election judges. Subd. 2.Volunteer service; election judge travel. (a) Any person appointed to serve as an election judge may elect to serve without payment by submitting a written statement to the appropriate governing body no later than ten days before the election. (b) Subdivision 1 does not require the payment of mileage or other travel expenses to an election judge residing in another jurisdiction, if the election judge's name was included on the list of individuals who indicated a willingness to travel to another jurisdiction provided under section 204B.21, subdivision 1. 1981 c 29 art 4 s 31; 1982 c 424 s 58; 1983 c 126 s 3; 1983 c 253 s 8; 1987 c 266 art 1 s 30; 1997 c 147 s 34; 2017 c 92 art 1 s 16 Subdivision 1.Payment. (a) The secretary of state shall pay the compensation for presidential electors and all necessary expenses incurred by the secretary of state in connection with elections. (b) The counties shall pay the compensation prescribed in section 204B.31, clauses (2) and (3), the cost of printing the state general election ballots when machines are used, the state partisan primary ballots, and the state and county nonpartisan primary ballots, all necessary expenses incurred by county auditors in connection with elections, and the expenses of special county elections. (c) Subject to subdivision 2, the municipalities shall pay the compensation prescribed for election judges and sergeants at arms, the cost of printing the municipal ballots, providing ballot boxes, providing and equipping polling places and all necessary expenses of the municipal clerks in connection with elections, except special county elections. (d) The school districts shall pay the compensation prescribed for election judges and sergeants-at-arms, the cost of printing the school district ballots, providing ballot boxes, providing and equipping polling places and all necessary expenses of the school district clerks in connection with school district elections not held in conjunction with state elections. When school district elections are held in conjunction with state elections, the school district shall pay the costs of printing the school district ballots, providing ballot boxes and all necessary expenses of the school district clerk. All disbursements under this section shall be presented, audited, and paid as in the case of other public expenses. Subd. 2.Allocation of election expenses. The secretary of state shall develop procedures for the allocation of election expenses among counties, municipalities, and school districts for elections that are held concurrently. The following expenses must be included in the procedures: salaries of election judges; postage for absentee ballots and applications; preparation of polling places; preparation and testing of electronic voting systems; ballot preparation; publication of election notices and sample ballots; transportation of ballots and election supplies; and compensation for administrative expenses of the county auditor, municipal clerk, or school district clerk. 1981 c 29 art 4 s 32; 1983 c 301 s 162; 1987 c 266 art 1 s 31; 1991 c 227 s 14; 1995 c 8 s 3; 2013 c 131 art 2 s 25 (a) At least 16 weeks before the state primary, the secretary of state shall notify each county auditor of the offices to be voted for in that county at the next state general election for which candidates file with the secretary of state. The notice shall include the time and place of filing for those offices. Within ten days after notification by the secretary of state, each county auditor shall notify each municipal clerk in the county of all the offices to be voted for in the county at that election and the time and place for filing for those offices. The county auditors and municipal clerks shall promptly post a copy of that notice in their offices. (b) At least one week before the first day to file an affidavit of candidacy, the county auditor shall publish a notice stating the first and last dates on which affidavits of candidacy may be filed in the county auditor's office and the closing time for filing on the last day for filing. The county auditor shall post a similar notice at least ten days before the first day to file affidavits of candidacy. 1981 c 29 art 4 s 33; 1983 c 253 s 9; 1993 c 59 s 1; 2010 c 184 s 16; 2013 c 131 art 2 s 26 Subdivision 1.State elections. At least 15 days before any state primary or state general election the municipal clerk shall post in the clerk's office a notice stating the offices for which candidates must be nominated or elected, the location of each polling place in the municipality, and the hours for voting. An optional provision of the notice may include municipal offices for which candidates must be nominated or elected. The county auditor shall post a similar notice in the auditor's office including information concerning any polling places in unorganized territory in the county. The governing body of a municipality or county may publish this notice in addition to posting it. Failure to give the notice required in this section shall not invalidate a state primary or state general election. Subd. 2.Municipal elections. Notice of municipal elections shall be given as provided in sections 205.13, subdivision 2; and 205.16, subdivision 1. Subd. 3.Judicial elections. When one or more justices of the supreme court or judges of the court of appeals or of a district court are to be nominated at the same primary or elected at the same general election, the notice of election shall state the name of each justice or judge whose successor is to be nominated or elected. Subd. 4.School district elections. Notice of school district elections shall be given as provided in sections 205A.06, subdivision 2; and 205A.07, subdivision 1. 1981 c 29 art 4 s 34; 1982 c 501 s 15; 1983 c 247 s 86; 1983 c 303 s 10; 1986 c 444; 1987 c 266 art 1 s 32; 1998 c 254 art 2 s 23; 2011 c 76 art 1 s 27 All ballots for every election shall be prepared in accordance with sections 204B.35 to 204B.44 and chapter 204D, except for voting machine ballots or as otherwise provided by law. Subd. 2.Manner of preparation. Ballots shall be prepared in a manner that enables the voters to understand which questions are to be voted upon and the identity and number of candidates to be voted for in each office and to designate their choices easily and accurately. The name of a candidate shall not appear on a ballot in any way that gives the candidate an advantage over an opponent, including words descriptive of the candidate's occupation, qualifications, principles, or opinions, except as otherwise provided by law. Subd. 3.Number. The official in charge of preparing ballots shall prepare a sufficient number of ballots: (1) to fill applications of absentee voters; and (2) to provide each precinct with a sufficient number of ballots of each kind as required by section 204B.29, subdivision 1. Subd. 4.Absentee ballots; preparation; delivery. At least 46 days before an election, ballots necessary to fill applications of absentee voters shall be prepared and delivered to the officials who administer the provisions of chapter 203B, except as provided in this subdivision. Ballots necessary to fill applications of absentee voters for a town general election held in March shall be prepared and delivered to the town clerk at least 30 days before the election. This section applies to school district elections held on the same day as a statewide election or an election for a county or municipality located partially or wholly within the school district. Subd. 5.Combined local elections. Municipalities shall determine the voting method in combined local elections when other election jurisdictions located wholly or partially within the municipality schedule elections on the same date as the regular municipal primary or general election. 1981 c 29 art 4 s 35; 1983 c 303 s 11; 1985 c 72 s 3; 1986 c 444; 1986 c 475 s 14; 1987 c 62 s 4; 1987 c 266 art 1 s 33; 1991 c 227 s 15; 2010 c 184 s 17; 2013 c 131 art 2 s 27 Subdivision 1.Type. All ballots shall be printed with black ink on paper of sufficient thickness to prevent the printing from being discernible from the back. All ballots shall be printed in easily readable type with suitable lines dividing candidates, offices, instructions and other matter printed on ballots. The same type shall be used for the names of all candidates on the same ballot. Subd. 2.Candidates and offices. The name of each candidate shall be printed at a right angle to the length of the ballot. At a general election the name of the political party or the political principle of each candidate for partisan office shall be printed above or below the name of the candidate. The name of a political party or a political principle shall be printed in capital and lowercase letters of the same type, with the capital letters at least one-half the height of the capital letters used for names of the candidates. At a general election, blank lines containing the words "write-in, if any" shall be printed below the name of the last candidate for each office, or below the title of the office if no candidate has filed for that office, so that a voter may write in the names of individuals whose names are not on the ballot. One blank line shall be printed for each officer of that kind to be elected. At a primary election, no blank lines shall be provided for writing in the names of individuals whose names do not appear on the primary ballot. On the left side of the ballot at the same level with the name of each candidate and each blank line shall be printed an oval or similar target shape in which the voter may designate a vote by filling in the oval or similar mark if a different target shape is used. Each oval or target shape shall be the same size. Above the first name on each ballot shall be instructions for voting. Directly underneath the official title of each office shall be printed the words "Vote for one" or "Vote for up to ..." (any greater number to be elected). Subd. 3.Question; form of ballot. When a question is to be submitted to a vote, a concise statement of the nature of the question shall be printed on the ballot. The words, "Yes" and "No" shall be printed to the left of this statement, with an oval or similar target shape to the left of each word so that the voter may indicate by a mark either a negative or affirmative vote. The ballot shall include instructions directing the voter to fill in the oval or similar mark if a different target shape is used, before the word "Yes" if the voter desires to vote for the question, or to fill in the oval or similar mark if a different target shape is used, before the word "No" if the voter desires to vote against the question. Subd. 4.Judicial candidates. The official ballot shall contain the names of all candidates for each judicial office and shall state the number of those candidates for whom a voter may vote. Each seat for an associate justice, associate judge, or judge of the district court must be numbered. The words "Supreme Court," "Court of Appeals," and "(number) District Court" must be printed above the respective judicial office groups on the ballot. The title of each judicial office shall be printed on the official primary and general election ballot as follows: (1) In the case of the supreme court: "Chief justice"; "Associate justice (number)"; (2) In the case of the court of appeals: "Judge (number)"; or (3) In the case of the district court: "Judge (number)." Subd. 5.Designation of incumbent; judicial offices. If a chief justice, associate justice, or judge is a candidate to succeed again, the word "incumbent" shall be printed after that judge's name as a candidate. 1981 c 29 art 4 s 36; 1983 c 247 s 87; 1983 c 253 s 10; 1984 c 560 s 14; 1986 c 362 s 4; 1986 c 444; 1991 c 221 s 1; 1993 c 318 art 2 s 45; 1997 c 147 s 35; 2004 c 293 art 2 s 22; 2013 c 131 art 2 s 28; 2015 c 70 art 1 s 27-30 On the back of all ballots shall be printed the words "Official Ballot", the date of the election and lines for the initials of at least two election judges. The words shall be printed so that they will be visible when the ballot is properly folded for deposit in the ballot box. When the similarity of both the first and last names of two or more candidates for the same office at the same election may cause confusion to voters, up to three additional words may be printed on the ballot after each surname to indicate the candidate's occupation, office, residence or any combination of them if the candidate furnishes the identifying words to the filing officer by the last day for withdrawal of candidacy. If a sufficient number of official ballots are not delivered or if the official ballots are stolen or destroyed and a sufficient number of official ballots cannot be procured, the official in charge of preparing the official ballots shall prepare substitute ballots in the form prescribed by this section. The substitute ballots shall be prepared in the same form as official ballots as far as practicable. The word "Substitute" shall be printed in brackets immediately above the words "Official Ballot." When the substitute ballots are delivered to the municipal clerks or election judges they shall be accompanied by an initialed affidavit of the officer preparing them. The affidavit shall state that the substitute ballots have been prepared and furnished in the manner prescribed by this section and shall state the reason why sufficient official ballots were not ready for delivery. The election judges shall include this affidavit with the election returns from that precinct. The county auditors, municipal clerks, and school district clerks shall retain all election materials returned to them after any election for at least 22 months from the date of that election. All election materials involved in a contested election must be retained for 22 months or until the contest has been finally determined, whichever is later. Abstracts filed by canvassing boards shall be retained permanently by any officer with whom those abstracts are filed. Election materials no longer required to be retained pursuant to this section shall be disposed of in accordance with sections 138.163 to 138.21. Sealed envelopes containing voted ballots must be retained unopened, except as provided in this section, in a secure location. The county auditor, municipal clerk, or school district clerk shall not permit any voted ballots to be tampered with or defaced. After the time for filing a notice of contest for an election has passed, the secretary of state may, for the purpose of monitoring and evaluating election procedures: (1) open the sealed ballot envelopes and inspect the ballots for that election maintained by the county auditors, municipal clerks, or school district clerks; (2) inspect the polling place rosters and completed voter registration applications; or (3) examine other forms required in the Minnesota election laws for use in the polling place. No inspected ballot or document may be marked or identified in any manner. After inspection, all ballots must be returned to the ballot envelope and the ballot envelope must be securely resealed. Any other election materials inspected or examined must be secured or resealed. No polling place roster may be inspected until the voting history for that precinct has been posted. No voter registration application may be inspected until the information on it has been entered into the statewide registration system. 1981 c 29 art 4 s 40; 1987 c 175 s 7; 1989 c 291 art 1 s 10; 1995 c 8 s 4; 2000 c 467 s 19; 2006 c 242 s 19 Every person authorized or employed to print official ballots who knowingly gives or delivers those ballots to, or knowingly permits them to be taken by, any person other than the official under whose direction they are being printed, or who knowingly prints any ballot or causes or permits any ballot to be printed in a form other than that prescribed by law, or with any other names on it, or with the names of candidates or the titles of offices arranged or the names of candidates spelled in any way other than that authorized and directed by that official, is guilty of a felony. (a) Any individual may file a petition in the manner provided in this section for the correction of any of the following errors, omissions, or wrongful acts which have occurred or are about to occur: (1) an error or omission in the placement or printing of the name or description of any candidate or any question on any official ballot, including the placement of a candidate on the official ballot who is not eligible to hold the office for which the candidate has filed; (2) any other error in preparing or printing any official ballot; (3) failure of the chair or secretary of the proper committee of a major political party to execute or file a certificate of nomination; (4) any wrongful act, omission, or error of any election judge, municipal clerk, county auditor, canvassing board or any of its members, the secretary of state, or any other individual charged with any duty concerning an election. (b) The petition shall describe the error, omission, or wrongful act and the correction sought by the petitioner. The petition shall be filed with any judge of the supreme court in the case of an election for state or federal office or any judge of the district court in that county in the case of an election for county, municipal, or school district office. The petitioner shall serve a copy of the petition on the officer, board or individual charged with the error, omission, or wrongful act, on all candidates for the office in the case of an election for state, federal, county, municipal, or school district office, and on any other party as required by the court. Upon receipt of the petition the court shall immediately set a time for a hearing on the matter and order the officer, board or individual charged with the error, omission or wrongful act to correct the error or wrongful act or perform the duty or show cause for not doing so. In the case of a review of a candidate's eligibility to hold office, the court may order the candidate to appear and present sufficient evidence of the candidate's eligibility. The court shall issue its findings and a final order for appropriate relief as soon as possible after the hearing. Failure to obey the order is contempt of court. 1981 c 29 art 4 s 44; 1986 c 444; 1990 c 453 s 6; 2014 c 204 s 1; 2015 c 70 art 1 s 31 Subdivision 1.Authorization. A town of any size not located in a metropolitan county as defined by section 473.121, or a city having fewer than 400 registered voters on June 1 of an election year and not located in a metropolitan county as defined by section 473.121, may provide balloting by mail at any municipal, county, or state election with no polling place other than the office of the auditor or clerk or other locations designated by the auditor or clerk. The governing body may apply to the county auditor for permission to conduct balloting by mail. The county board may provide for balloting by mail in unorganized territory. The governing body of any municipality may designate for mail balloting any precinct having fewer than 100 registered voters, subject to the approval of the county auditor. Voted ballots may be returned in person to any location designated by the county auditor or municipal clerk. Subd. 2.Procedure. Notice of the election and the special mail procedure must be given at least ten weeks prior to the election. Not more than 46 days nor later than 14 days before a regularly scheduled election and not more than 30 days nor later than 14 days before any other election, the auditor shall mail ballots by nonforwardable mail to all voters registered in the city, town, or unorganized territory. No later than 14 days before the election, the auditor must make a subsequent mailing of ballots to those voters who register to vote after the initial mailing but before the 20th day before the election. Eligible voters not registered at the time the ballots are mailed may apply for ballots as provided in chapter 203B. Ballot return envelopes, with return postage provided, must be preaddressed to the auditor or clerk and the voter may return the ballot by mail or in person to the office of the auditor or clerk. The auditor or clerk must appoint a ballot board to examine the mail and absentee ballot return envelopes and mark them "accepted" or "rejected" within three days of receipt if there are 14 or fewer days before election day, or within five days of receipt if there are more than 14 days before election day. The board may consist of deputy county auditors or deputy municipal clerks who have received training in the processing and counting of mail ballots, who need not be affiliated with a major political party. Election judges performing the duties in this section must be of different major political parties, unless they are exempt from that requirement under section 205.075, subdivision 4, or section 205A.10. If an envelope has been rejected at least five days before the election, the ballots in the envelope must remain sealed and the auditor or clerk shall provide the voter with a replacement ballot and return envelope in place of the spoiled ballot. If the ballot is rejected within five days of the election, the envelope must remain sealed and the official in charge of the ballot board must attempt to contact the voter by telephone or e-mail to notify the voter that the voter's ballot has been rejected. The official must document the attempts made to contact the voter. If the ballot is accepted, the county auditor or municipal clerk must mark the roster to indicate that the voter has already cast a ballot in that election. After the close of business on the seventh day before the election, the ballots from return envelopes marked "Accepted" may be opened, duplicated as needed in the manner provided by section 206.86, subdivision 5, initialed by the members of the ballot board, and deposited in the ballot box. In all other respects, the provisions of the Minnesota Election Law governing deposit and counting of ballots apply. The mail and absentee ballots for a precinct must be counted together and reported as one vote total. No vote totals from mail or absentee ballots may be made public before the close of voting on election day. The costs of the mailing shall be paid by the election jurisdiction in which the voter resides. Any ballot received by 8:00 p.m. on the day of the election must be counted. Subd. 3.Election Law applied; rules. The Minnesota Election Law is applicable to mail balloting except as provided by this section or by rules adopted by the secretary of state, but only paper ballots may be used. The secretary of state shall adopt rules for the conduct of mail balloting, including instructions to voters, procedures for challenge of voters, public observation of the counting of ballots, and procedures for proper handling and safeguarding of ballots to ensure the integrity of the election. 1987 c 212 s 8; 1990 c 585 s 26; 1991 c 227 s 16; 1993 c 318 art 1 s 1; 1997 c 145 s 1; 2008 c 244 art 1 s 12; 2010 c 184 s 18; 2010 c 194 s 16; 2011 c 18 s 4; 2011 c 76 art 1 s 70; 2013 c 131 art 2 s 29,30; 2015 c 70 art 1 s 32; 2016 c 161 art 1 s 8 A county, municipality, or school district submitting questions to the voters at a special election may conduct an election by mail with no polling place other than the office of the auditor or clerk. No offices may be voted on at a mail election. Notice of the election must be given to the county auditor at least 74 days prior to the election. This notice shall also fulfill the requirements of Minnesota Rules, part 8210.3000. The special mail ballot procedures must be posted at least six weeks prior to the election. Not more than 46 nor later than 14 days prior to the election, the auditor or clerk shall mail ballots by nonforwardable mail to all voters registered in the county, municipality, or school district. No later than 14 days before the election, the auditor or clerk must make a subsequent mailing of ballots to those voters who register to vote after the initial mailing but before the 20th day before the election. Eligible voters not registered at the time the ballots are mailed may apply for ballots pursuant to chapter 203B. The auditor or clerk must appoint a ballot board to examine the mail and absentee ballot return envelopes and mark them "Accepted" or "Rejected" within three days of receipt if there are 14 or fewer days before election day, or within five days of receipt if there are more than 14 days before election day. The board may consist of deputy county auditors, deputy municipal clerks, or deputy school district clerks who have received training in the processing and counting of mail ballots, who need not be affiliated with a major political party. Election judges performing the duties in this section must be of different major political parties, unless they are exempt from that requirement under section 205.075, subdivision 4, or section 205A.10. If an envelope has been rejected at least five days before the election, the ballots in the envelope must remain sealed and the auditor or clerk must provide the voter with a replacement ballot and return envelope in place of the spoiled ballot. If the ballot is rejected within five days of the election, the envelope must remain sealed and the official in charge of the ballot board must attempt to contact the voter by telephone or e-mail to notify the voter that the voter's ballot has been rejected. The official must document the attempts made to contact the voter. If the ballot is accepted, the county auditor or municipal clerk must mark the roster to indicate that the voter has already cast a ballot in that election. After the close of business on the seventh day before the election, the ballots from return envelopes marked "Accepted" may be opened, duplicated as needed in the manner provided by section 206.86, subdivision 5, initialed by the ballot board, and deposited in the appropriate ballot box. The mail and absentee ballots for a precinct must be counted together and reported as one vote total. No vote totals from ballots may be made public before the close of voting on election day. 1987 c 213 s 1; 1989 c 291 art 1 s 11; 1993 c 223 s 11; 2008 c 295 s 13; 2009 c 88 art 6 s 4; 2010 c 180 s 4; 2010 c 194 s 17; 2011 c 18 s 5; 2013 c 131 art 2 s 31; 2014 c 264 s 16 When a provision of the Minnesota Election Law cannot be implemented as a result of an order of a state or federal court, the secretary of state shall adopt alternative election procedures to permit the administration of any election affected by the order. The procedures may include the voting and handling of ballots cast after 8:00 p.m. as a result of a state or federal court order or any other order extending the time established by law for closing the polls. The alternative election procedures remain in effect until the first day of July following the next succeeding final adjournment of the legislature, unless otherwise provided by law or by court order. 1997 c 147 s 36; 2004 c 293 art 1 s 29 The secretary of state, county auditor, municipal clerk, school district clerk, or an election judge may provide a sticker containing the words "I VOTED," and nothing more, to an individual who: (1) has successfully deposited a ballot into a ballot box, under section 203B.081, subdivision 3, or 204C.13, subdivision 5; (2) is provided an absentee ballot under section 203B.07, subdivision 1, or 203B.21, subdivision 2; or (3) is provided a ballot by mail under section 204B.45 or 204B.46.
{ "redpajama_set_name": "RedPajamaCommonCrawl" }
2,510
<?php /** * Created by JetBrains PhpStorm. * User: chaosin * Date: 02.10.12 * Time: 9:25 * To change this template use File | Settings | File Templates. */ class ValidatorOldPassword extends sfValidatorSchema { public function __construct($newpass, $oldpass, $options = array(), $messages = array()) { $this->addOption('newpass', $newpass); $this->addOption('oldpass', $oldpass); $this->addOption('throw_global_error', false); parent::__construct(null, $options, $messages); } /** * @see sfValidatorBase */ protected function doClean($values) { if (is_null($values)) { $values = array(); } if (!is_array($values)) { throw new InvalidArgumentException('You must pass an array parameter to the clean() method'); } $newpass = isset($values[$this->getOption('newpass')]) ? $values[$this->getOption('newpass')] : null; $oldpass = isset($values[$this->getOption('oldpass')]) ? $values[$this->getOption('oldpass')] : null; $valid = false; if( $newpass != '' && $newpass != null) { if ($oldpass != null && $oldpass != '') { $user = sfContext::getInstance()->getUser()->getGuardUser(); if (!$user->checkPassword($oldpass)) { $error = new sfValidatorError($this, 'Invalid password', array('oldpass' => $oldpass)); if ($this->getOption('throw_global_error')) { throw $error; } throw new sfValidatorErrorSchema($this, array($this->getOption('oldpass') => $error)); } } else { $error = new sfValidatorError($this, 'Required', array('oldpass' => $oldpass)); if ($this->getOption('throw_global_error')) { throw $error; } throw new sfValidatorErrorSchema($this, array($this->getOption('oldpass') => $error)); } } return $values; } }
{ "redpajama_set_name": "RedPajamaGithub" }
4,698
{"url":"https:\/\/zbmath.org\/?q=an:1070.11029","text":"# zbMATH \u2014 the first resource for mathematics\n\nBinomial sums related to rational approximations to $$\\zeta(4)$$. (English. Russian original) Zbl\u00a01070.11029\nMath. Notes 75, No. 4, 594-597 (2004); translation from Mat. Zametki 75, No. 4, 637-640 (2004).\nIn \u201cAn Ap\u00e9ry-like difference equation for Catalan\u2019s constant\u201d [Electron. J. Combin. 10, No. 10, R14 (2003; Zbl 1093.11075)], the author considered the following series $S_n=\\sum_{k=1}^{\\infty} \\frac{\\partial^2}{\\partial k ^2} \\left(\\bigg(k+\\frac{n}{2}\\bigg) \\frac{(k-1)\\dots (k-n)(k+n+1)\\dots(k+2n)}{k^2(k+1)^2\\dots (k+n)^2} \\right)$ and showed that there exist two explicit sequences $$(u_n)_{n\\geq 0}$$ and $$(v_n)_{n\\geq 0}$$ of rationals such that $$S_n=u_n \\zeta(4)-v_n$$ and $$d_nu_n\\in {\\mathbb Z}$$ and $$d_n^5v_n\\in {\\mathbb Z}$$ where $$d_n=\\text{lcm}\\{1,2,\\dots, n\\}.$$ Such a series falls under the scope of a conjecture made by the reviewer [in \u201cS\u00e9ries hyperg\u00e9om\u00e9triques et irrationalit\u00e9 des valeurs de la fonction z\u00eata de Riemann\u201d, J. Th\u00e9or. Nombres Bordx. 15, 351\u2013365 (2003; Zbl 1041.11051)] concerning the denominators of the rational coefficients of certains linear forms in odd or even zeta values obtained by the use of very-well-poised hypergeometric series (of which $$S_n$$ is an example). In this case, the conjecture asserts that in fact $$u_n\\in{\\mathbb Z}$$ and $$d_n^4v_n\\in {\\mathbb Z}$$, something that cannot be trivially deduced from the explicit expressions obtained for both sequences.\nThis conjecture was proved by C. Krattenthaler and the reviewer [in \u201cHyperg\u00e9om\u00e9trie et fonction z\u00eata de Riemann\u201d, preprint available at http:\/\/arxiv.org\/abs\/math.NT\/0311114] by proving suitable alternative expressions for the sequences of rationals which appear. For example, in the case of $$\\zeta(4)$$, for all $$n\\geq0$$, one has $u_n=\\sum_{0\\leq i\\leq j \\leq n} \\binom{n}{i}^2 \\binom{n}{j}^2 \\binom{n+j}{n} \\binom{n+j-i}{n} \\binom{2n-i}{n}. \\tag{1}$ The solution relied, amongst other things, on a huge identity relating a single sum and a multiple sum, both of hypergeometric shape.\nIn the paper under review, another proof of (1) is given using a more compact hypergeometric identity of G. E. Andrews [in \u201cProblems and prospects for basic hypergeometric functions\u201d, Theory and application of special functions, 191\u2013224 (1975; Zbl 0342.33001)], which also relates a single sum and a multiple sum: it appeared later that the huge identity and Andrews\u2019s one are nothing but the same identity. Using certain symmetries in Andrews\u2019s formula, the author also provides five alternative expressions for $$u_n$$ similar to (1), such as $u_n=(-1)^n\\sum_{0\\leq i\\leq j\\leq n}(-1)^j\\binom{n+i}{n}^3\\binom{3n+1}{j-i}\\binom{2n-j}{n}^3.$ This is an interesting observation, which could be useful to prove the general conjecture made by the author in [\u201cArithmetic of linear forms involving odd zeta values\u201d, J. Th\u00e9or. Nombres Bordx. 16, 251\u2013291 (2004; Zbl 1156.11327)].\n\n##### MSC:\n 11J99 Diophantine approximation, transcendental number theory 33C20 Generalized hypergeometric series, $${}_pF_q$$\n##### Citations:\nZbl 1041.11051; Zbl 0342.33001; Zbl 1093.11075; Zbl 1156.11327\nFull Text:","date":"2022-01-17 19:14:58","metadata":"{\"extraction_info\": {\"found_math\": true, \"script_math_tex\": 0, \"script_math_asciimath\": 0, \"math_annotations\": 0, \"math_alttext\": 0, \"mathml\": 0, \"mathjax_tag\": 0, \"mathjax_inline_tex\": 1, \"mathjax_display_tex\": 1, \"mathjax_asciimath\": 0, \"img_math\": 0, \"codecogs_latex\": 0, \"wp_latex\": 0, \"mimetex.cgi\": 0, \"\/images\/math\/codecogs\": 0, \"mathtex.cgi\": 0, \"katex\": 0, \"math-container\": 0, \"wp-katex-eq\": 0, \"align\": 0, \"equation\": 0, \"x-ck12\": 0, \"texerror\": 0, \"math_score\": 0.7903173565864563, \"perplexity\": 632.3634291751214}, \"config\": {\"markdown_headings\": true, \"markdown_code\": true, \"boilerplate_config\": {\"ratio_threshold\": 0.18, \"absolute_threshold\": 10, \"end_threshold\": 5, \"enable\": true}, \"remove_buttons\": true, \"remove_image_figures\": true, \"remove_link_clusters\": true, \"table_config\": {\"min_rows\": 2, \"min_cols\": 3, \"format\": \"plain\"}, \"remove_chinese\": true, \"remove_edit_buttons\": true, \"extract_latex\": true}, \"warc_path\": \"s3:\/\/commoncrawl\/crawl-data\/CC-MAIN-2022-05\/segments\/1642320300616.11\/warc\/CC-MAIN-20220117182124-20220117212124-00716.warc.gz\"}"}
null
null
[Fit Years: 1991-1996] Hitch Brake Light "GMC" [Fit Years: 1991-1996] Hitch Brake Light "Chevrolet" [Fit Years: 1991-1996] 6 In. x 8 In. [Fit Years: 1991-1996] Window Tint Film, Splash, 24 Ft. x 6.5 Ft. [Fit Years: 1991-1996] Fits Tire Diameter: 26.5 In. - 29.5 In. [Fit Years: 1991-1996] Oil Pressure Gauge 2-1/2 In. [Fit Years: 1991-1996] Volt Gauge 2-1/2 In. [Fit Years: 1991-1996] Water Temp Gauge 2-1/2 In. [Fit Years: 1991-1996] Oil Temperature Gauge 2-1/2 In. [Fit Years: 1991-1996] 1 Pieces. 34 In.x 5 In. [Fit Years: 1991-1996] 2 Pieces. 25 In.x 8 In. [Fit Years: 1991-1996] 2 Pieces. 6 In.x 2 In., 1 Pieces. 25 In.x 8 In. [Fit Years: 1991-1996] 7 RV To 6 Round Coil Adaptor Expands Up To 3 Ft. [Fit Years: 1991-1996] 6 Round To 6 Round Coil Adaptor Expands Up To 3 Ft.
{ "redpajama_set_name": "RedPajamaC4" }
1,277
E-filing and Submission of Tax Returns Until 2007 taxpayers had no choice but to file paper-based tax returns with SARS. This required the completion of a paper-based return and also the submission of the taxpayers' supporting documents and tax certificates. SARS then introduced e-filing, whereby taxpayers could register for e-filing and submit their tax returns electronically. With e-filing it is not possible to submit supporting documents when, for example, an individual files their tax return, the ITR12. Furthermore, taxpayers have a choice to register for e-filing personally and file their returns themselves or they can appoint a registered tax practitioner to act on their behalf and file their returns. The Tax Administration Act ('the Act') sets out who must register as a tax practitioner, as well as the statutory obligations arising where a person is a registered tax practitioner. A registered tax practitioner must be a member of a SARS Recognised Controlling Body or a body recognised by the Act. All registered tax practitioners must adhere to the code of professional conduct prescribed by their controlling body. If the practitioner does not comply with their code of conduct or the provisions of the Act, SARS can lodge a complaint against the practitioner. The failure to file returns on time can give rise to action being taken by SARS against the taxpayer or tax practitioner. Image bought from i-Stock "Compliance Diagram" by stuartmiles99 Although a taxpayer appoints a tax practitioner to submit tax returns on their behalf, the taxpayer retains the legal obligations imposed by the Act. Thus, if the tax practitioner fails to submit a tax return at all or on time, the taxpayer can be subjected to the administrative penalties for late submission of returns, which can range from R 250 per month to R 16 000 per month that the return remains outstanding. The penalty amount depends on the taxpayer's level of income. The failure by a tax practitioner to file returns on time can give rise to action being taken by SARS against the tax practitioner. However, this does not detract from the taxpayer's personal liability for the failure to lodge a return. SARS can still subject the taxpayer to the administrative penalty and prosecute the taxpayer for non-submission of a return. Should a taxpayer be dissatisfied with the service received from a tax practitioner, they should terminate the agreement with the tax practitioner. The taxpayer may have a basis on which to lodge a formal complaint with the practitioner's controlling body or with SARS itself where the practitioner has violated the Act. If a practitioner delays the submission of a return they can face action by SARS itself. In addition, the taxpayer must remember that the e-filing profile belongs to the taxpayer and can be retrieved from the tax practitioner at any time. SARS indicated recently that it will use the National Prosecuting Authority to prosecute taxpayers in the Tax Court for the failure to submit tax returns. It must be remembered that the failure to submit a return when required to do so constitutes a criminal offence, which can give rise to a fine or a period of imprisonment. This will, on a successful prosecution, result in the taxpayer having a criminal record. Taxpayers using e-filing must ensure that they do not allow unauthorised persons to obtain their login and password details. The Office of the Tax Ombud has in its various annual reports indicated that there have been too many cases of identity theft where taxpayers have been duped into making their passwords available to unauthorised third parties. Once a return is filed via e-filing, SARS will often request that the taxpayer submits the documents to support the filed return. The taxpayer should receive notice of such verification requests via e-mail or SMS. The taxpayer is entitled to receive proper notice of SARS requests and, in my opinion, it is not sufficient for SARS to merely post a letter on the taxpayer's e-filing profile. E-filing has allowed SARS to enhance its data matching processes to ensure that taxpayers properly declare all income derived by them. Should a taxpayer choose not to declare all income received or accrued they will be subject to the understatement penalty, which can range from 10% to 200% of the income tax underpaid. E-filing has its advantages to both taxpayers and SARS in that returns can be processed far more quickly than paper-based returns. However, taxpayers must still submit their tax returns on time. Where a tax practitioner is appointed, that person must act professionally and should not delay the filing of returns without a good reason. Whether returns are filed via e-filing or manual submission, or managed by a tax practitioner or the taxpayers personally, the taxpayer remains liable for the failure to submit a tax return on time. Dr Beric Croome is a Tax Executive at ENSafrica. This article first appeared in Business Day, Business Law and Tax Review, May 2018. Labels: e-filing; tax returns, SARS, tax penalties, taxpayers
{ "redpajama_set_name": "RedPajamaCommonCrawl" }
1,684
{"url":"http:\/\/physics.stackexchange.com\/questions\/45995\/hamilton-operator-in-absence-of-causal-order","text":"# Hamilton operator in absence of causal order?\n\nI hope, this question isn't too broad or vague.\n\nIn a recent paper, Ognyan Oreshkov et al. worked out a theory of quantum correlations in absence of any causal order, dropping the assumptions of a space-time: See their paper here.\n\nNow I wonder (please refer to the linked paper), would it even be possible to define a Hamiltionian in absence of a space-time to refer to? And if so, how would one do that?\n\n-\nVery interesting. I never really liked the idea of casualty anyway. Is the fact that events could be seen as happening in different orders from different observers in special relativity relevant? How does this formulation address the holistic-ness of states? \u2013\u00a0 namehere Dec 5 '12 at 13:39\nI'm not entirely sure. At the very least they mention general relativity in their paper in two contexts: Assuming only local correctness of QM is equivalent to assume only local flatness of space in GR. And in the sublementary informations to the paper (see the very bottom of the linked page for a pdf of that), they mention that one term of the generic solution to a two-observer-problem, which, however, breaks unity of probability, is equivalent to a certain kind of time-like loops as described in one of their references. So if GR gets a mention, SR surely is related as well. \u2013\u00a0 kram1032 Dec 5 '12 at 13:47\nI'll be sure to look all this up when I have more time. However, as the the formulation is completely local, the validity of a Hamiltonian does become less clear. \u2013\u00a0 namehere Dec 5 '12 at 14:00\n\n## 1 Answer\n\nThe Hamiltonian is the generator of time-translations. If you eliminate time from the description no true Hamiltonian can exist.\n\n-","date":"2014-09-01 14:25:40","metadata":"{\"extraction_info\": {\"found_math\": false, \"script_math_tex\": 0, \"script_math_asciimath\": 0, \"math_annotations\": 0, \"math_alttext\": 0, \"mathml\": 0, \"mathjax_tag\": 0, \"mathjax_inline_tex\": 0, \"mathjax_display_tex\": 0, \"mathjax_asciimath\": 0, \"img_math\": 0, \"codecogs_latex\": 0, \"wp_latex\": 0, \"mimetex.cgi\": 0, \"\/images\/math\/codecogs\": 0, \"mathtex.cgi\": 0, \"katex\": 0, \"math-container\": 0, \"wp-katex-eq\": 0, \"align\": 0, \"equation\": 0, \"x-ck12\": 0, \"texerror\": 0, \"math_score\": 0.8081619143486023, \"perplexity\": 769.1339052402739}, \"config\": {\"markdown_headings\": true, \"markdown_code\": true, \"boilerplate_config\": {\"ratio_threshold\": 0.18, \"absolute_threshold\": 10, \"end_threshold\": 15, \"enable\": false}, \"remove_buttons\": true, \"remove_image_figures\": true, \"remove_link_clusters\": true, \"table_config\": {\"min_rows\": 2, \"min_cols\": 3, \"format\": \"plain\"}, \"remove_chinese\": true, \"remove_edit_buttons\": true, \"extract_latex\": true}, \"warc_path\": \"s3:\/\/commoncrawl\/crawl-data\/CC-MAIN-2014-35\/segments\/1409535919066.8\/warc\/CC-MAIN-20140901014519-00198-ip-10-180-136-8.ec2.internal.warc.gz\"}"}
null
null
using System.Reflection; using System.Runtime.InteropServices; [assembly: AssemblyTitle("Server class library")] [assembly: AssemblyDescription("")] [assembly: Guid("ae109377-7860-4793-b97f-5864cd8196bd")]
{ "redpajama_set_name": "RedPajamaGithub" }
7,492
Biografia Ha tre figli, tutti calciatori, dei quali è divenuto anche procuratore: Lamisha (1992), Tika (1994) e Charly Jr. (1996). Carriera Descritto come un centrocampista che era in possesso sia del tiro sia di un buon lancio, trascorre la maggior parte della sua carriera da professionista nell'Anderlecht, ove coglie 10 titoli (4 campionati belgi) in 10 stagioni, solo 3 giocate da titolare. Appende le scarpette al chiodo nel 1998. Vanta 24 presenze in Europa: 7 in Champions, 8 in Coppa UEFA, 9 in Coppa delle Coppe. In Nazionale gioca tra il 1988 e il 1993, contando una cinquantina di presenze. Il 27 aprile 1993, in quanto infortunato, non prese parte alla trasferta della sua squadra contro il Senegal. Questo infortuno gli salvò la vita, evitandogli di perire nel Disastro aereo dello Zambia. Palmarès Club Competizioni nazionali Anderlecht: 1987-1988, 1988-1989, 1993-1994 Anderlecht: 1987, 1993, 1995 Anderlecht: 1990-1991, 1992-1993, 1993-1994, 1994-1995 Note Collegamenti esterni Calciatori della Nazionale zambiana
{ "redpajama_set_name": "RedPajamaWikipedia" }
2,039
2017-06-06 Report is not available on-line. You may contact Licensing for a hard copy at a cost of $0.25 per page. 2016-02-24 Report is not available on-line. You may contact Licensing for a hard copy at a cost of $0.25 per page. 2016-02-24 No deficiencies were cited on this date. 2014-06-23 No deficiencies were cited on this date. 2013-12-03 No deficiencies were cited on this date. 2013-07-23 No deficiencies were cited on this date. Be the first to review this childcare provider. Write a review about First Baptist Day School. Let other families know what's great, or what could be improved. Please read our brief review guidelines to make your review as helpful as possible.
{ "redpajama_set_name": "RedPajamaC4" }
8,724
Onthophagus borneensis är en skalbaggsart som beskrevs av Edgar von Harold 1877. Onthophagus borneensis ingår i släktet Onthophagus och familjen bladhorningar. Inga underarter finns listade i Catalogue of Life. Källor Externa länkar Bladhorningar borneensis
{ "redpajama_set_name": "RedPajamaWikipedia" }
586
We are on the twelfth day of the Red Skywalker Wavespell ~ Yellow Crystal Seed Day. If we are ready to move forwards and into a space of maturity we look and learn from our past ~ or we can play the blame game. There is a certain woman who is being honoured or slated today ~ The Iron Lady Margaret Thatcher. How have we changed in the UK since she was the leader of government ? For something that happened such a long time ago……there is still a huge amount of vitriol being expressed and lighting up our energetic universe. Have we moved on ? How is life different in our society today ? Not much that I am noticing. People are still having a good moan and rant….. Haven't we learned that this doesn't actually change anything? If we are ready for a change then let's take responsibility for how we all create our way of living everyday and truly learn….. create something new by changing what we do. We are using her as a scapegoat to avoid taking responsibility for our role in society at that time. I am no paragon of virtue…..yet he without sin cast the first stone ~ seems like a good rule of thumb for fairness? Of course we could say the same about Adolph Hitler and blame him……for all the atrocities that no one else got their hands dirty with…..really? Out of interest for my own awareness I have checked out their Mayan signs. Margaret was a Blue Crystal Night ~ learning about co creation rather than co-dependence as a number 12 . Blue's create transformation through death…..and if we look back in a couple of hundred years from now we may see how her energy created a shift ~ at the perfect time in our evolution ~ that is those of us who choose to be conscious and see the bigger picture and how we learn from every episode in our evolution. Adolph Hitler is also a blue and it was a surprise for me to learn that he was a blue galactic hand ~ blue hand generally being regarded as a healing energy sign ~ however as I said before ~ who are we to see the intricate structures being woven in divine time? Being a number eight ~ all about integrity and integration. I am not seeking to justify or honour anything about these individual's behaviour ~ simply seeking to share an awareness of what that has created to raise our understanding and consciousness as beings that learn experientially ~ often this involves great pain and suffering. So few manipulate so many because the masses are unconscious……and that is meant to be otherwise it wouldn't be so…..there is nothing wrong with our world ….it is simply reflecting where we are. If we are to move away from that pattern then seeing clearly how it came into being ~ because it matched our majority collective unconscious beliefs , especially around personal responsibility and victim patterns ~ to change our future we change from the inside and then this changes the outside. The majority of our population aren't yet tuned in to this understanding because ……we aren't ready to feel our personal pain and get over it ~ to renew our selves now. It is the soul process. What do we achieve in reality when we vent our spleen? We let some steam off ~ for our ego. What any of us project onto any change bringers ~ is a reflection of our own shadow is all. Margaret Thatcher is simply an archetypal pattern for each individual to have their own individual pattern match ego dance with. Does she represent your Mother? Grandmother? A teacher who was mean to you? Someone who pushed your buttons as a child? At the height of her time she was in a space that took a while in the making …….an ancient pattern……and it is still here :-)It shapes into different forms with a new spin doctor is all. If we are to create new seeds of loving relationships then we all have to take responsibility for creating these new plants. New frameworks to support their growth. This takes people who are willing to own their behaviour and their part in the collective and learn about new paradigms. Blame allows our shadow ego to avoid focusing on itself ~ it's a smoke and mirrors routine ~let's crucify that person and that regime and what we resist persists….. The inner wounded child hates change . Still doing a job they hate….. Still hanging out with the same group of people they don't really like? Living in the same village they grew up in? Margaret was in one aspect…. the ball breaker who came head to head with many individuals…. who were at the height of their ego trip…..and with all these individuals we can see how their ego had expanded to a black hole proportion……..this balanced the weighing scales for the number of individuals who totally handed over all their decision making to others…..and then muttered over their beer about it……beat their wives up instead…..beat their friends up……displaced their anger instead of confronting the people fairly and honestly about their situation …..with a view to changing it. I have never met a miner who said they loved their job….and I knew a lot of them. Sadly some drank themselves to death rather than make a change. Some people hated being miners….they thought they had to do it……some people chose not too and left to seek something else. At the time of the strikes my parents had a small business and it was affected adversely by the power cuts ~ many people were and they weren't asked how they felt about that by the striking people or included in a vote about it……… Is that not bullying aggressive behaviour? Is that fair or inclusive ? How many lived in fear when the lights went out? The huge amounts of rubbish? What did any of the riots achieve……I don't remember a positive from it . Our history shows that we become the behaviour we abhor in order to overcome our fear ~ there is another option ~ dealing with our fear and creating new models of relating to each other. The villages and the people are still there. Some are still victims, some are survivors and some ……a minority…..are thrivers because they saw potential in the change and took it. Some people behaved badly and people died as a result ~ and just like every tragic story in history some of the people who murdered others were part of their own community who felt justified in doing that because they had a certain set of rules. All this rage has it's price and as long as someone feels they are justified at imposing their rules on another……. and in turn everyone suffers. This is the root of bullying. When you look closer at what came before the explosion point you see the pattern ~ it isn't about the big event where the explosion happens…..the seeds are planted many years before that. If you look at Adolph Hitler's family pattern you can see how so many infant deaths and family tension between him and his father started an avalanche . People who shared his pattern shared his vision. We all have this shadow on some level because we are all human beings. This behaviour only ever comes from fear….. So what I am saying is….. If we now face our fear ~ because it is simple to do and the tools are there to do it ~ we let go of it. When we engage with others free of rage there is no opposing force so resistance ends. We do not have to accept bullying behaviour and we can let go of adding fuel to the fire that builds into rioting and war. Many people crave drama because their own life is empty of colour and meaning for them ~ hence the huge reliance on soaps. It is possible to let go of that but only if we are ready to go for the hero's journey and be our own hero rather than waiting for someone to rescue us. I have just watched Secret State on channel four and for the first time in many years saw "debates" from the houses of parliament. It reminded me of how it's like a school playground for goodness sake ~ these people get paid good money to have childish digs at each other ~ oooo I'm cleverer than you ~ and they are running our country ~ now ~ because …..Some of them fall asleep……and that's ok….. On TV…… Because you need a big ego to feel you can run a country ~ or pretend that you can as a front for the bank ~ and this is no different for any political party.It's the next step up from putting business in the direction of friend's at the golf club ~ which is where most ego creativity happens in truth and has always been so. The little clique's so evident in our town's and villages throughout the UK. If you face fits……. We can see the pretence of difference now in the political parties ~ opposition ~ all the same stuff ~ ego. I love the outcome ~ I also know it ain't likely to happen anytime soon because…….it isn't a match for where we are. We are still letting the banks's do whatever they wish because we aren't ready to hand over our future based never never pattern and the security of our credit card……so it will take another big push to slide the collective off the cliff…..unless we learn to leap before we are pushed….which takes an evolved being. Pretty thin on the ground……a rare species 🙂 More are being birthed through adversity by busting out of the cocoon and seeing the matrix at last. Peace brings peace and peace begins with me. No person or time is all bad. There were many wonderful things in the eighties. From our adversity we find strength to create new ways of being. These change makers in our midst show us where we can bring light and although we may resist letting go of what we know….. we can find that if we open our hearts and be vulnerable instead……the change always brings us new possibilities. There were dark times in the eighties …. and there were wonderful times too……let's let the wounds go…. truly, deeply, emotionally and energetically because if we don't……. Nothing will change. It isn't someone else's job to parent us or our world…..it is ours. What are you doing to create a difference? I was hearing today some people talk about how mining communities near Leeds had never recovered. But like you say, and I can totally believe it, you never heard a miner say they loved their job – I can't believe anyone would love doing that. But people just didn't and still don't have the courage to make a change. Yes, I remember the 80s as a harsh time, but also probably the last time we had an explosion of creativity in music and fashion. And yes, we all have to look at the man in the mirror (to quote another often reviled man).
{ "redpajama_set_name": "RedPajamaC4" }
6,713
\section{Introduction}\label{secIntro} \begin{figure}[ht] \begin{center} \vspace{-0.5cm} \includegraphics[width=0.5\textwidth]{./DisegnoPaper.png} \vspace{-2cm} \caption{State feedback control scheme.}\label{figMCNScheme} \end{center} \end{figure} Wireless control networks (WCN) are distributed control systems where the communication between sensors, actuators, and computational units is supported by a wireless communication network. The use of WCN in industrial automation results in flexible architectures and generally reduces installation, debugging, diagnostic and maintenance costs with respect to wired networks (see e.g. \cite{akyildiz_wireless_2004}, \cite{SongIECON2010} and references therein). However modeling, analysis and design of (wireless) networked control systems are challenging open research problems since they require to take into account the joint dynamics of physical systems, communication protocols and network infrastructures. Recently, a huge effort has been made in scientific research on NCSs, see e.g. \cite{Astrom97j1},~\cite{Zhang2001},~\cite{walsh_stability_2002},~\cite{Arzen06},~\cite{TabbaraTAC2007},~\cite{Hespanha2007},~\cite{MurrayTAC2009},~\cite{HeemelsTAC11},~\cite{AlurTAC11},~\cite{PajicTAC2011},~\cite{DInnocenzoTAC13} and references therein for a general overview. To make a WCN robust to packets losses redundancy in data routing can be used. One approach to exploit this redundancy is relaying data via multiple paths and then appropriately combining them, which is reminiscent of network coding. In \cite{SmarraECC15} we considered a state-feedback control loop as in Figure \ref{figMCNScheme} where multiple copies $u_1(k)=u_2(k)=\ldots=u_r(k)=Kx_P(k)$ of the same actuation data are sent from the controller to the plant via $r$ different routing paths $\{\rho_i\}_{i=1}^r$ each characterised by a delay $d_i$ and a packet losses probability $p_i$. We assumed that the time-invariant controller gain $K$ is designed via classical methods to assign the eigenvalues of the closed-loop system in the nominal case, i.e. when the effect of packet losses is not considered. We also assumed that the actuator computes a linear combination $\sum_{i=1}^{r}\gamma_i u_i(k-d_i)$ of the data incoming from different routing paths, and we provided a suboptimal algorithm to compute the optimal weights $\gamma_i$ that maximize a metric induced by the notion of Mean Square Stability. In this paper we continue the research line started in \cite{SmarraECC15} and provide novel results that strongly improve the controller performance. The first difference is motivated by the following consideration: when routing redundancy is exploited in communication systems the objective is to relay some information, and thus we send to the network the same packet $u_1(k)=\ldots=u_r(k)$ and try to extract from the corrupted received packets the original information; in our case the objective is to increase the control performance, as a consequence the actuation packets $u_1(k), \ldots, u_r(k)$ must not be necessarily equal. In this paper we perform \emph{controller and routing redundancy co-design} by designing the time-varying matrix $\mathbb{R}^{rm \times n} \ni K(k) \doteq [K_1(k) \in \mathbb{R}^{m \times n}; \cdots; K_r(k)\in \mathbb{R}^{m \times n}]$. Note that the problem formulation in \cite{SmarraECC15} is a special case of the above definition where $K(k) = [\gamma_1 K^*; \cdots; \gamma_r K^*]$ and $K^*$ is designed for the nominal case. As a further improvement, while in \cite{SmarraECC15} we optimise a metric based on the notion of Mean Square Stability (i.e. only taking into account the steady state behavior) we consider here a more complex control specification that also takes into account the transient behavior by setting up a finite-horizon LQR problem. In \cite{MHNAUT12} the authors also consider redundant data transmission over a set of paths characterised by i.i.d. Bernoulli probabilities of packet losses, but for a more restricted scenario with respect to ours because they assume that all paths are associated with the same delay, the packet loss events are measurable, the controller is designed for the nominal case (i.e. without considering the effect of packet losses) and redundant data combination is not modeled/designed. Their focus is on deciding how many redundant copies of a packet should be transmitted at each sampling time and what benefits can be drawn from this: besides the fact that our model is more general, we also address the more general problem of co-designing controller and routing redundancy. In Section \ref{secModel} we define a network modeling framework that allows co-design of controller and routing redundancy while taking into account the effect of packet losses and in Section \ref{secProblem} we provide our LQR problem formulation. In Section \ref{secStaticRouting} we assume that the set of paths used at each time instant to send actuation data to the actuator has be designed a priori: we will call this approach static routing redundancy. We setup the problem of co-desiging the controller gain and the routing redundancy parameters as a LQR problem for a Discrete-Time Markov-Jump Linear System (dtMJLS) where the discrete mode (which correpsond to the occurrence of packet losses) is unmeasurable and evolves according to a sequence of i.i.d. random variables. The latter assumption, widely adopted for several communication systems, makes particularly sense in our framework since exploitation of redundant data is well known to be very effective especially in the case when the reduntant paths used for data relay are uncorrelated from the point of view of the communication channels' characteristics. The proof for solving the LQR problem for such a system, being the discrete state unmeasurable, is an extension of the solution for dtMJLS in \cite{costa_discrete-time_2005} and can be derived without much difficulty thanks to the i.i.d. assumption. Note that a similar problem has been addressed in \cite{BarasProcIFAC}, with the assumption that the discrete state is measurable with a one step delay, and solved without proof: we believe that the proof in this case is very close to ours, but since we were unable to find it in the scientific literature we provide one in this paper for the sake of completeness. We apply our optimal solution to a simple example where actuation data can be sent to the actuator via two paths: the first characterised by short delay (i.e. fast reaction to perturbations) and high probability of packet losses (i.e. low reliablity); the second characterised by long delay (i.e. slow reaction to perturbations) and $0$ probability of packet losses (i.e. perfect reliablity). Note that such situation can often occur in realistic cases: one example is a multi-hop wireless network where we can reach the destination via a single long hop (short delay, high packet loss probability) or via a path of very short multiple hops (high delay, low packet loss probability); another example is a service provider network where we can reach the destination via the shortest yet congested path of routers (short delay, high packet loss probability) or via a longer uncongested path of routers (high delay, low packet loss probability). In the above situations, using only the first path is clearly not a good idea since the closed loop system may easily become unstable. Using only the second path is the optimal solution to maximise bandwidht, i.e. optimal from the point of view of communication theory: however, due to the high delay, the control system is not reactive to perturbations. The main idea that motivates this paper is based on the intuition that we could use both paths simultaneously, exploiting the fast reaction of the first path and the high reliability of the second path in an optimal way taking into account the plant dynamics. Our Monte Carlo (MC) simultations show that routing actuation data on both paths simultaneously and applying our optimal solution, we can tremendously improve the performance of both single-path solutions from the point of view of control performance. In Section \ref{secDynamicRouting} we consider a much more complicated problem: we assume that the set of paths used at each time instant to send data to the actuator can be controlled, i.e. the choice of redundant routing paths is also a control variable: we will call this approach dynamic routing redundancy. We setup the problem of co-desiging the controller gain, routing redundancy parameters and paths as a LQR problem for a class of systems that includes dtMJLS as a special case and provide, as the main theoretical contribution of this paper, a recursive solution that is optimal for a certain set of initial conditions, which we define in closed form. More precisely, our model is a dtMJLS where we can also apply a discrete control that, choosing some of the system matrices, models the choice of the routing at each time step. A similar model has been considered in \cite{VargasCDC2010}, where only a sub-optimal solution is provided based on a conservative approximation (see the proof of this paper for more details). Similar problems have also been considered, but for determinstic models, in \cite{AbateACC2009} and \cite{BemporadAutomatica2005}. Finally, in \cite{PappasTAC2014} a different LQR optmisation problem is considered where the discrete and continuous control signals are independent and can be designed separately, which is not the case in our problem. \section{Network Modeling}\label{secModel} Consider a state-feedback networked control loop as in Figure \ref{figMCNScheme} where the communication between the controller and the actuator can be performed via a set of $r$ routing paths $\{\rho_i\}_{i=1}^r$ in a wireless multi-hop communication network. Each path $\rho_i$ is characterised by a delay $d_i \in \mathbb{N^+}$ and a packet loss probability $p_i \in [0,1]$ that represents the probability that the packet transmitted on that path will not reach the actuator due to communication failure. In particular, we define for each path $\rho_i$ the stochastic process $\sigma_i(k) \in \{0,1\}$, with $\sigma_i(k)=0$ if the packet expected to arrive via the routing path $\rho_i$ at time $k$ suffered a packet drop and $\sigma_i(k)=1$ if the packet is succesfully received at time $k$. We assume that $\sigma_i(k)$ is a sequence of i.i.d. random variables, each characterised by a Bernoulli distribution with probability measure $\mathbb{P}[\sigma_i(k)=0]=p_i$. We also assume here that the events of occurrence of packet losses in the different paths are i.i.d.: as a consequence the stochastic process $\sigma(k) \doteq [\sigma_1(k), \ldots, \sigma_r(k)]'$ is a vector of i.i.d. random variables, where $\sigma(k)$ can assume $2^r$ values. We also assume that the controller cannot measure the signal $\sigma(k)$, i.e. it is not possible to measure the occurrence of packet losses. The case when the occurrence of packet losses is measurable with finite delay thanks to acknowledgement packets will be investigated in future work. We assume that, in general, the controller can decide for each time instant $k$ the set of paths where data will be sent: i.e., the controller can decide to send data at time $k$ on all paths, on a subset of paths, on one path, or even not to send any data. To this aim we define for each path $i$ the discrete control signal $a_i(k) \in \{0,1\}$, with $a_i(k)=1$ if the controller decides to send a packet via the routing path $i$ at time $k$, and $a_i(k)=0$ if no packet is sent via path $i$ at time $k$. We define the discrete control signal $a(k) \doteq [a_1(k), \ldots, a_r(k)]'$, where $a(k)$ can be choosen among $2^r$ different values. Let the plant be a discrete-time LTI system described by the matrices $A_P \in \mathbb{R}^{\ell \times \ell}$ , $B_P \in \mathbb{R}^{\ell \times m}$, we define the dynamics of the networked system as follows: \begin{equation}\label{eqMainModelNetwork} \begin{cases} x(k+1) = A_{\sigma(k)}x(k) + B_{a(k)}u(k)\\ y(k) = x(k) \end{cases} \end{equation} with \tiny \begin{align*} A_{\sigma(k)} &= \left[\begin{matrix} A_P & \Lambda_{1}(\sigma(k)) & \Lambda_{2}(\sigma(k)) & \cdots & \Lambda_{r}(\sigma(k)) \\ 0 & \Gamma_{1} & 0 & \cdots & 0 \\ 0 & 0 & \Gamma_{2} & \cdots & 0 \\ \vdots & \vdots & \vdots & \ddots & \vdots \\ 0 & 0 & 0 & \cdots & \Gamma_{r} \end{matrix}\right] \in \mathbb R^{\ell+\nu(r) \times \ell+\nu(r)},\\ B_{a(k)} &= \left[\begin{matrix} 0 & 0 & \cdots & 0\\ a_1(k) I_m \otimes \textbf{e}_{d_1} & 0 & \cdots & 0 \\ 0 & a_2(k) I_m \otimes \textbf{e}_{d_2} & \cdots & 0 \\ \vdots & \vdots & \ddots & \vdots \\ 0 & 0 & \cdots & a_r(k) I_m \otimes \textbf{e}_{d_r} \\ \end{matrix}\right] \in \mathbb R^{\ell + \nu(r) \times mr}, \end{align*} \normalsize with \tiny \begin{align*} &\Lambda_i(\sigma(k)) \doteq \sigma_i(k) \left[\begin{matrix} B_P & 0 & \cdots & 0 \end{matrix}\right] \in \mathbb R^{\ell \times md_i},\\ &\Gamma_{i} \doteq \left[\begin{matrix} 0 & I_m & \cdots & 0 & 0 \\ \vdots & \vdots & \ddots & \vdots & \vdots \\ 0 & 0 & \cdots & I_m & 0 \\ 0 & 0 & \cdots & 0 & I_m \\ 0 & 0 & \cdots & 0 & 0 \end{matrix}\right] \in \mathbb R^{{md_i} \times {md_i}},\\ \end{align*} \normalsize and with $\nu(i) \doteq m\sum\limits_{j=1}^{i}d_j$, $I_m$ the $m$-dimensional identity matrix, $\textbf{e}_{i}$ a column vector of appropriate dimension with all zero entries except the $i-th$ entry equal to 1, and $\otimes$ the Kronecker product. System \eqref{eqMainModelNetwork} is more general than dtMJLSs: in particular, when $\forall k \geq 0, a(k) = a_k$ (i.e. the routing is designed a priori) System \eqref{eqMainModelNetwork} is a dtMJLSs. Note that in our feedback scheme we assume that the controller can measure the whole state $x(k) = [x_P(k)' x_N(k)']'$ of \eqref{eqMainModelNetwork}, where $x_P(k) \in \mathbb{R}^\ell$ is the state of the plant and $x_N(k) \in \mathbb{R}^{\nu(r)}$ are state variables modeling the flow of packets via all routing paths. We assume that the controller can measure the state $x_P(k)$ of the plant via sensors and defer to future work the output-feedback case. Also, the controller is aware of the current and past actuation signals $u(k)$ that have been sent to the actuator, as well as of the current and past signals $a(k)$ (which is either constant for any $k$ or choosen by the controller): as a consequence the controller has direct access to the state of $x_N(k)$, which models the actuation commands that are expected to arrive at the actuator, but is not aware of their arrival to the actuator since $\sigma(k)$ is not measurable. \section{Problem Formulation}\label{secProblem} The network modeling framework in the previous section is a special case of the following mathematical framework, which is the one we will use in the rest of the paper: \begin{equation}\label{eqMainModel} \begin{cases} x(k+1) = A_{\sigma(k)}x(k) + B_{a(k)}u(k)\\ y(k) = x(k) \end{cases}, \end{equation} where $x(k) \in \mathbb{R}^n, u(k) \in \mathbb{R}^{mr}, \sigma(k) \in \{1, \ldots, q\} \doteq \Sigma, a(k) \in \{1, \ldots, p\} \doteq A$, and $\sigma(k), k \geq 0$ is a sequence of i.i.d. random variables such that $\mathbb{P}[\sigma(k) = i] = \pi_i$ for any $i \in \Sigma, k \geq 0$. \begin{problem}\label{probMain} Given System \eqref{eqMainModel}, design for any $k \in \{0,\ldots,N-1\}$ an optimal state-feedback control policy $a^*(x(k)), u^*(k) = K^*(x(k))x(k)$, with $a^*(x(k)): \mathbb{R}^n \rightarrow A$ and $K^*(x(k))$ a $m \times n$ matrix of reals, minimizing the following objective function: \tiny \begin{align*} &J(x(0), u(0), a(0))=E \left\{ \sum_{k=0}^{N-1} \left(x'(k)Mx(k)+u'(k)Ru(k)\right) + x'(N)Qx(N) \big| \aleph_{0}\right\} \end{align*} \normalsize where $\aleph_{k}$ is the sigma algebra generated by $x(0),...,x(k)$. \end{problem} \section{Co-design of controller and static routing redundancy}\label{secStaticRouting} In this Section we address Problem \ref{probMain} assuming that the routing has beed designed a priori. \begin{theorem}\label{thStaticRoutingResult} Given System \eqref{eqMainModel} and a routing policy defined by $\forall k \geq 0, a(k) = a_k \in A$, the optimal solution of Problem \ref{probMain} is given by a sequence $K^*(k)$ with $k =0,\ldots,N-1$. \emph{Proof:} The proof is constructive and shows how to compute $K^*(k)$ for any $k =0,\ldots,N-1$.We start from the classical Belmann optimization formulation (\cite{LancasterRiccati}, \cite{BertsekasOptStocCon}): \tiny \begin{equation} \begin{cases} J(x(k), u(k)) =\\ \min\limits_{a(k), u(k)} E \{x'(k)Mx(k)+u'(k)Ru(k)+J(x(k+1), u(k+1)) | \aleph_{k} \}\\ \\ J(x(N) , u(N)) = J(x(N)) = x'(N) E\{Q | \aleph_{N}\} x(N) = x'(N) P(N) x(N) \end{cases} \end{equation} \normalsize where $P(N) \doteq Q$ is a symmetric matrix and $J(x(k), u(k))$ is the cost-to-go function at time $k$. Let us write the cost-to-go function at step $N-1$: \footnotesize \begin{align*} & J(x(N-1),u(N-1))=\\ & \min_{u(N-1)} E \Big\{x'(N-1)Mx(N-1)+u'(N-1)Ru(N-1) +\\ & + x'(N)P(N)x(N) \Big| \aleph_{N-1} \Big\}=\\ & \min_{u(N-1)} E \Big\{x'(N-1)Mx(N-1)+u'(N-1)Ru(N-1) +\\ & (x'(N-1)A'_{\sigma(N-1)}+u'(N-1)B_{a_{N-1}}')P(N)(A_{\sigma(N-1)}x(N-1)+\\ & B_{a_{N-1}}u(N-1)) \Big| \aleph_{N-1} \Big\} \end{align*} \normalsize By linearity of the expected value we can write: \tiny \begin{align}\label{LQRsplitStaticRouting} &J(x(N-1),u(N-1))=\notag\\ &\min\limits_{u(N-1)} \Big\{ E \{x'(N-1)Mx(N-1) | \aleph_{N-1} \}+\notag\\ &E \{u'(N-1)Ru(N-1) | \aleph_{N-1}\} +\notag\\ &E \{(x'(N-1)A'_{\sigma(N-1)}P(N)A_{\sigma(N-1)}x(N-1) | \aleph_{N-1}\} +\notag\\ &E \{(x'(N-1)A'_{\sigma(N-1)}P(N)B_{a_{N-1}}u(N-1) | \aleph_{N-1}\} +\notag\\ &E \{(u'(N-1)B_{a_{N-1}}'P(N)A_{\sigma(N-1)}x(N-1) | \aleph_{N-1}\} +\notag\\ &E \{u'(N-1))B_{a_{N-1}}'P(N)B_{a_{N-1}}u(N-1) |\aleph_{N-1}\} \Big\} \end{align} \normalsize Let us consider each addend of the rightside of \eqref{LQRsplitStaticRouting}. Since $M$ and $R$ are constant matrices, $x(N-1)$ is $\aleph_{N-1}$-measurable, and $u(N-1)$ is not a random variable since it is the input that we choose to apply to the system at time $N-1$, the first two addends can be written as \tiny \begin{align*} &E \{x'(N-1)Mx(N-1) +u'(N-1)Ru(N-1)| \aleph_{N-1}\}= \\ &x'(N-1)Mx(N-1) +u'(N-1)Ru(N-1). \end{align*} \normalsize Moreover, $x'(N-1)Mx(N-1)$ does not depend on $u(N-1)$ and can be moved out of the min operator. The third addend can be written as \begin{align*} &E \{(x'(N-1)A'_{\sigma(N-1)}P(N)A_{\sigma(N-1)}x(N-1) | \aleph_{N-1}\}=\\ &x'(N-1) E \{A'_{\sigma(N-1)}P(N)A_{\sigma(N-1)}| \aleph_{N-1}\} x(N-1) \doteq\\ &x'(N-1) \Phi(N-1)(N-1), \end{align*} \normalsize where $\Phi(N-1) = \sum\limits_{i=1}^{q} A'_iP(N)A_i \pi_i$. Since $x(N-1)$ is $\aleph_{N-1}$-measurable, $P(N)$ is symmetric and $\sigma(k)$ are i.i.d., the sum of the fourth and fifth addends can be written as \begin{align*} &2E \{(x'(N-1)A'_{\sigma(N-1)}P(N)B_{a_{N-1}}u(N-1) | \aleph_{N-1}\}=\\ &2x'(N-1)E \{ A'_{\sigma(N-1)}P(N)| \aleph_{N-1}\}B_{a_{N-1}}u(N-1) =\\ &2x'(N-1)E \{ A'_{\sigma(N-1)} \} P(N) B_{a_{N-1}}u(N-1) =\\ &2x'(N-1) \bar A' P(N) B_{a_{N-1}}u(N-1), \end{align*} where $\bar A \doteq E\{A_{\sigma(N-1)}\} = \sum_{i=1}^q A_i \pi_i$. The last addend can be written as: \begin{align*} &E \{u'(N-1))B_{a_{N-1}}'P(N)B_{a_{N-1}}u(N-1) |\aleph_{N-1}\}=\\ &u'(N-1))B_{a_{N-1}}' P(N) B_{a_{N-1}}u(N-1). \end{align*} We can now rewrite \eqref{LQRsplitStaticRouting} as follows: \tiny \begin{align} \label{costo_n-1StaticRouting} &J(x(N-1),u(N-1))= x'(N-1)\left[M+ \Phi(N-1) \right]x(N-1)+\notag\\ &\min\limits_{u(N-1)} \Big\{ 2x'(N-1) \bar A' P(N) B_{a_{N-1}}u(N-1)+\notag\\ & u'(N-1))B_{a_{N-1}}' P(N) B_{a_{N-1}}u(N-1)+u'(N-1)Ru(N-1)\Big\} \end{align} \normalsize We can compute the minimun of the above function with respect to $u(N-1)$ by equaling the derivative with respect to $u(N-1)$ to $0$: \tiny \begin{equation} \begin{split} 2x'(N-1) \bar A' P(N) B_{a_{N-1}} + 2u'(N-1)\left[ B_{a_{N-1}}' P(N) B_{a_{N-1}}+R \right] =0, \end{split} \end{equation} \normalsize which gets to \tiny \begin{align*} &u(N-1)= -\left[R+ B_{a_{N-1}}' P(N) B_{a_{N-1}} \right]^{-1} B_{a_{N-1}}' P(N) \bar A x(N-1). \end{align*} \normalsize We have thus obtained a linear feedback of the state given by \begin{equation} u(N-1)=K^*(N-1)x(N-1) \end{equation} By replacing the expression of $u(N-1)$ in the cost function \eqref{costo_n-1StaticRouting} it is possible to obtain \tiny \begin{align*} & J(x(N-1)) =\\ & x'(N-1)\Big[M+\Phi(N-1) + \bar A' P(N) B_{a_{N-1}} \left(R+B_{a_{N-1}}'P(N) B_{a_{N-1}} \right)^{-1} \cdot \\ & B_{a_{N-1}}' P(N) \bar A \Big] x(N-1) \doteq x'(N-1) P(N-1) x(N-1). \end{align*} \normalsize By iterating this procedure for a generic $k$ it is possible to obtain the expression for $K^*(k)$ \begin{equation} \label{controllore} K^*(k) = -\left[R+ B_{a_{k}}' P(k+1) B_{a_{k}} \right]^{-1} B_{a_{k}}'P(k+1) \bar A. \end{equation} This concludes the proof.$\qed$ \end{theorem} We apply the above theorem to the following System \eqref{eqMainModelNetwork} characterised by a 4-dimensional unstable randomly generated plant \tiny \begin{align*} A_P &= \left[\begin{matrix} 1.1062 & -1.0535 & 0.7944 & -0.4543\\ 0.0202 & -0.0654 & 0.9697 & -0.6888\\ 0.1131 & -0.5755 & 1.7434 & -0.7174\\ 0.0745 & -0.2565 & 0.2999 & 0.7252\\ \end{matrix}\right], B_P = \left[\begin{matrix} -0.1880\\ 0.0182\\ 0.1223\\ 0.2066\\ \end{matrix}\right], \end{align*} \normalsize and by a wireless network carachterized by two paths: $\rho_1$ with packet loss probability $p_1=0.25$ and delay $d_1=1$ and $\rho_2$ with packet loss probability $p_2 = 0$ and delay $d_2=5$. We applied Theorem \ref{thStaticRoutingResult} to three simple routing strategies, i.e. using for all time instants only path $\rho_1$, only path $\rho_2$ or both paths simultaneously. We computed our solution for a time horizon $N=300$ and defined the weight matrices $M,R,Q$ and initial condition $x(0)$ as follows: \tiny \begin{align*} &\text{If routing via both } \rho_1,\rho_2:\\ &M=Q = \left[\begin{matrix} I_4 & 0\\ 0 & 0 \end{matrix}\right] \in \mathbb R^{10 \times 10}, R = I_2, x(0) = (1,1,1,1,0,\ldots,0) \in \mathbb R^{10};\\ &\text{if routing via } \rho_1:\\ &M=Q= \left[\begin{matrix} I_4 & 0\\ 0 & 0 \end{matrix}\right] \in \mathbb R^{5 \times 5},\quad R = 1, \quad x(0) = (1,1,1,1,0,\ldots,0) \in \mathbb R^{5};\\ &\text{if routing via } \rho_2:\\ &M=Q = \left[\begin{matrix} I_4 & 0\\ 0 & 0 \end{matrix}\right] \in \mathbb R^{9 \times 9},\quad R = 1, \quad x(0) = (1,1,1,1,0,\ldots,0) \in \mathbb R^{9}. \end{align*} \normalsize For each routing strategy we performed $5K$ MC simulations of the state trajectories. Figure \ref{figPath1} shows the trajectories of the first component of the extended state vector when only path $\rho_1$ is used. The system can be stabilized, but the variance of the trajectories is high. In many other simulations the whole system can't be stabilized only using path $\rho_1$, many state trajectories are unstable because of the very high packet loss probability. This routing policy is clearly a bad choice. \begin{figure}[h!] \begin{center} \includegraphics[width=0.5\textwidth]{./path1FINAL.eps} \caption{State trajectories routing only via path $\rho_1$ (blue) and their average (red).}\label{figPath1} \end{center} \end{figure} Figure \ref{figPaths12} shows the trajectories when only path $\rho_2$ is used (Red) and when both paths $\rho_1$ and $\rho_2$ are used (Blue and green). Routing data only to path $\rho_2$ clearly generates always the same trajectory since $p_2 = 0$. The system trajectory is stable but the associated cost is quite high because of the large delay, as evidenced by the overshoot and the settling time performances. Figure \ref{figPaths12} evidences that routing data via both paths $\rho_1$ and $\rho_2$ the control performance strongly improves: in particular, the trajectory of the system computed by averaging over all MC simulations is characterised by much smaller overshoot and faster settling time. The single trajectories generated routing data via both paths $\rho_1$ and $\rho_2$ clearly have some variance due to the high packet loss probability $p_1$: however, in the $5K$ MC simulations, the performance of any of the single trajectories is much better than the case when only path $\rho_2$ is used. \begin{figure}[h!] \begin{center} \includegraphics[width=0.5\textwidth]{./path12e2FINAL.eps} \caption{State trajectory routing only via path $\rho_2$ (red dashed); state trajectories routing via both paths $\rho_1$ and $\rho_2$ (blue) and their average (green).}\label{figPaths12} \end{center} \end{figure} Table \ref{tabCosts} shows the tremendous improvement of the controller performance obtained by exploiting both paths and co-designing controller gains and static routing redundancy parameters. \begin{table}[h] \label{tabCosts} \begin{center} \begin{tabular}{|c|c|} \hline & Averaged cost\\ \hline Via path $\rho_1$ & $\sim 900$\\ \hline Via path $\rho_2$ & $\sim 250$\\ \hline Via paths $\rho_1, \rho_2$ & $\sim 100$\\ \hline \end{tabular} \end{center} \caption{Cost averaged over 5K MC sims.} \end{table} Finally, the averaged actuation signals $v_2(k) = u_2(k-5)$ routing via path $\rho_2$ and $v_{1,2}(k) = u_1(k-1) + u_2(k-5)$ routing via both paths are shown in Figure \ref{figControlSignals}: note that the actuation cost (i.e. energy) associated to the case when we use only path $\rho_2$ is much larger w.r.t. to the case when we use both paths $\rho_1$ and $\rho_2$. \begin{figure}[h!] \begin{center} \includegraphics[width=0.5\textwidth]{./controlInputFINAL.eps} \caption{Actuation signal $v_2(k) = u_2(k-5)$ (red) routing via path $\rho_2$; averaged actuation signal $v_{1,2}(k) = u_1(k-1) + u_2(k-5)$ (blue) routing via both paths.}\label{figControlSignals} \end{center} \end{figure} Using our approach it is possible to compute, for a finite set of predefined routing policies, the associated expected quadratic cost and choose the cheapest policy. To further improve the performance one can dynamically choose, for each packet and according to the plant state measurement, the routing path: this is the problem we address in the next section. \section{Co-design of controller and dynamic routing redundancy}\label{secDynamicRouting} In this section we provide a suboptimal solution of Problem \ref{probMain} that is optimal for a certain set of initial conditions, which we define in closed form. \begin{theorem}\label{thMainResult} Given System \eqref{eqMainModel}, a solution of Problem \ref{probMain} is given by the sequence, $\forall k =0,\ldots,N-1$, of $a^*(x(k))$, $K^*(x(k))$ defined by a finite partition $\Omega(k) \doteq \{\Omega_{i}(k)\}_{i=1}^{\omega(k)}$ of $\mathbb{R}^n$, each assocated with a pair $a_i, K_i$ such that $a^*(x(k)) = a_i, K^*(x(k)) = K_i \iff x(k) \in \Omega_i(k)$. Any $\Omega_i(k)$ can be defined by a finite set of quadratic inequalities in the form $x'Yx \sim 0$, $\sim \in \{<, \leq, \geq, >\}$ with $Y$ a $n \times n$ symmetric matrix of reals. Moreover, at each step $k$ such solution is optimal for a subset $\iota(k) \subseteq \{0,\ldots,\omega(k)\}$. \emph{Proof:} The proof is constructive and shows how to compute each $\Omega_i(k)$. We start from the classical Belmann optimization formulation: \tiny \begin{equation} \begin{cases} J(x(k), u(k), a(k)) =\\ \min\limits_{a(k), u(k)} E \{x'(k)Mx(k)+u'(k)Ru(k)+J(x(k+1), u(k+1), a(k+1)) | \aleph_{k} \}\\ \\ J(x(N) ,u(N), a(N)) = J(x(N)) = x'(N) E\{Q | \aleph_{N}\} x(N) = x'(N) P(N) x(N) \end{cases} \end{equation} \normalsize where $P(N) \doteq Q$ is a symmetric matrix and $J(x(k), u(k), a(k))$ is the cost-to-go function at time $k$. We first provide the optimal solution at step $N-1$. Then we provide the optimal solution at step $N-2$ given the optimal solution at step $N-1$. The optimal solution at any other step $k = 1, \ldots, N-3$ can be obtained iterating the same reasoning of step $N-2$. \textit{Step $N-1$:} Let us write the cost-to-go function at step $N-1$: \footnotesize \begin{align*} & J(x(N-1),u(N-1),a(N-1))=\\ & \min_{a(N-1),u(N-1)} E \Big\{x'(N-1)Mx(N-1)+u'(N-1)Ru(N-1) +\\ & + x'(N)P(N)x(N) \Big| \aleph_{N-1} \Big\}=\\ & \min_{a(N-1),u(N-1)} E \Big\{x'(N-1)Mx(N-1)+u'(N-1)Ru(N-1) +\\ & (x'(N-1)A'_{\sigma(N-1)}+u'(N-1)B_{a(N-1)}')P(N)(A_{\sigma(N-1)}x(N-1)+\\ & B_{a(N-1)}u(N-1)) \Big| \aleph_{N-1} \Big\} \end{align*} \normalsize By linearity of the expected value we can write: \tiny \begin{align}\label{LQRsplit} &J(x(N-1),u(N-1),a(N-1))=\notag\\ &\min\limits_{a(N-1),u(N-1)} \Big\{ E \{x'(N-1)Mx(N-1) | \aleph_{N-1} \}+\notag\\ &E \{u'(N-1)Ru(N-1) | \aleph_{N-1}\} +\notag\\ &E \{(x'(N-1)A'_{\sigma(N-1)}P(N)A_{\sigma(N-1)}x(N-1) | \aleph_{N-1}\} +\notag\\ &E \{(x'(N-1)A'_{\sigma(N-1)}P(N)B_{a(N-1)}u(N-1) | \aleph_{N-1}\} +\notag\\ &E \{(u'(N-1)B_{a(N-1)}'P(N)A_{\sigma(N-1)}x(N-1) | \aleph_{N-1}\} +\notag\\ &E \{u'(N-1))B_{a(N-1)}'P(N)B_{a(N-1)}u(N-1) |\aleph_{N-1}\} \Big\} \end{align} \normalsize Let us consider each addend of the rightside of \eqref{LQRsplit}. Since $M$ and $R$ are constant matrices, $x(N-1)$ is $\aleph_{N-1}$-measurable, and $u(N-1)$ is not a random variable since it is the input that we choose to apply to the system at time $N-1$, the first two addends can be written as \tiny \begin{align*} &E \{x'(N-1)Mx(N-1) +u'(N-1)Ru(N-1)| \aleph_{N-1}\}= \\ &x'(N-1)Mx(N-1) +u'(N-1)Ru(N-1). \end{align*} \normalsize Moreover, $x'(N-1)Mx(N-1)$ does not depend on $a(N-1), u(N-1)$ and can be moved out of the min operator. The third addend can be written as \begin{align*} &E \{(x'(N-1)A'_{\sigma(N-1)}P(N)A_{\sigma(N-1)}x(N-1) | \aleph_{N-1}\}=\\ &x'(N-1) E \{A'_{\sigma(N-1)}P(N)A_{\sigma(N-1)}| \aleph_{N-1}\} x(N-1) \doteq\\ &x'(N-1) \Phi(N-1)(N-1), \end{align*} \normalsize where $\Phi(N-1) = \sum\limits_{i=1}^{q} A'_iP(N)A_i \pi_i$. Since $x(N-1)$ is $\aleph_{N-1}$-measurable, $P(N)$ is symmetric and $\sigma(k)$ are i.i.d., the sum of the fourth and fifth addends can be written as \begin{align*} &2E \{(x'(N-1)A'_{\sigma(N-1)}P(N)B_{a(N-1)}u(N-1) | \aleph_{N-1}\}=\\ &2x'(N-1)E \{ A'_{\sigma(N-1)}P(N)| \aleph_{N-1}\}B_{a(N-1)}u(N-1) =\\ &2x'(N-1)E \{ A'_{\sigma(N-1)} \} P(N) B_{a(N-1)}u(N-1) =\\ &2x'(N-1) \bar A' P(N) B_{a(N-1)}u(N-1), \end{align*} where $\bar A \doteq E\{A_{\sigma(N-1)}\} = \sum_{i=1}^q A_i \pi_i$. The last addend can be written as: \begin{align*} &E \{u'(N-1))B_{a(N-1)}'P(N)B_{a(N-1)}u(N-1) |\aleph_{N-1}\}=\\ &u'(N-1))B_{a(N-1)}' P(N) B_{a(N-1)}u(N-1). \end{align*} We can now rewrite \eqref{LQRsplit} as follows: \tiny \begin{align} \label{costo_n-1} &J(x(N-1),u(N-1),a(N-1))= x'(N-1)\left[M+ \Phi(N-1) \right]x(N-1)+\notag\\ &\min\limits_{a(N-1),u(N-1)} \Big\{ 2x'(N-1) \bar A' P(N) B_{a(N-1)}u(N-1)+\notag\\ & u'(N-1))B_{a(N-1)}' P(N) B_{a(N-1)}u(N-1)+u'(N-1)Ru(N-1)\Big\} \end{align} \normalsize For any given $a(N-1) \in A$ we can compute the minimun of the above function with respect to $u(N-1)$ by equaling the derivative with respect to $u(N-1)$ to $0$: \tiny \begin{equation} \begin{split} 2x'(N-1) \bar A' P(N) B_{a(N-1)} + 2u'(N-1)\left[ B_{a(N-1)}' P(N) B_{a(N-1)}+R \right] =0, \end{split} \end{equation} \normalsize which gets to \tiny \begin{align*} &u_{a(N-1)}(N-1)= -\left[R+ B_{a(N-1)}' P(N) B_{a(N-1)} \right]^{-1} B_{a(N-1)}' P(N) \bar A x(N-1). \end{align*} \normalsize We have thus obtained a linear feedback of the state given by \begin{equation} u_{a(N-1)}(N-1)=K_{a(N-1)}(N-1)x(N-1) \end{equation} By replacing the expression of $u_{a(N-1)}(N-1)$ in the cost function \eqref{costo_n-1} it is possible to obtain \tiny \begin{align*} & J(x(N-1), a(N-1)) =\\ & x'(N-1)\Big[M+\Phi(N-1) + \bar A' P(N) B_{a(N-1)} \left(R+B_{a(N-1)}'P(N) B_{a(N-1)} \right)^{-1} \cdot \\ & B_{a(N-1)}' P(N) \bar A \Big] x(N-1) \doteq x'(N-1) P_{a(N-1)}(N-1) x(N-1). \end{align*} \normalsize Let us now define a partition of $\mathbb{R}^n$ given by the collection of disjoint sets $\Omega(N-1) \doteq \{\Omega_i(N-1)\}_{i=1}^p$ where each $\Omega_i(N-1)$ is defined by \tiny \begin{align*} \Omega_i(N-1) \doteq \{x(N-1) \in \mathbb{R}^n : i = \arg\min\limits_{a(N-1)} J(x(N-1), a(N-1)) \}. \end{align*} \normalsize $\Omega_i(N-1)$ is the set of all states $x(N-1)$ such that the corresponding optimal discrete control is $a^*(x(k)) = i, K^*(x(k)) = K_{i}(N-1)$ and can be defined by the following set of inequalities: \begin{equation*} \begin{cases} x'(P_{i}(N-1) - P_{1}(N-1))x < 0\\ \vdots\\ x'(P_{i}(N-1) - P_{{i-1}}(N-1))x < 0\\ x'(P_{i}(N-1) - P_{{i+1}}(N-1))x \leq 0\\ \vdots\\ x'(P_{i}(N-1) - P_{{p}}(N-1))x \leq 0\\ \end{cases} \end{equation*} where the matrices are all symmetric. Note that $\Omega(k) = \{\Omega_i(N-1)\}_{i=1}^{p}$ is by definition a partition of $\mathbb{R}^n$. Each $\Omega_i(N-1)$ is associated with the discrete control $i$, the continuous state-feedback control $K_i(N-1)$ and the cost $P_i(N-1)$. Note that, at this step, each $\Omega_i(N-1)$ provides the optimal solution, i.e. $\iota(N-1) = \{1,\ldots,p\}$. \textit{Step $N-2$:} Given the optimal solution $\Omega(N-1)$ of step $N-1$ we provide the optimal solution at step $N-2$. Let us write the cost-to-go function at step $N-2$: \tiny \begin{align*} &J(x(N-2), u(N-2), a(N-2))=\\ &\min_{a(N-2),u(N-2)} E \Big\{x'(N-2)Mx(N-2)+u'(N-2)Ru(N-2) + \\ &x'(N-1)P(N-1)x(N-1) \Big| \aleph_{N-2} \Big\}, \end{align*} \normalsize By linearity of the expected value we can write: \tiny \begin{align}\label{LQRsplit2} &J(x(N-2),u(N-2),a(N-2))=\notag\\ &\min\limits_{a(N-2),u(N-2)} \Big\{ E \{x'(N-2)Mx(N-2) | \aleph_{N-2} \}+\notag\\ &E \{u'(N-2)Ru(N-2) | \aleph_{N-2}\} +\notag\\ &E \{(x'(N-2)A'_{\sigma(N-2)}P(N-1)A_{\sigma(N-2)}x(N-2) | \aleph_{N-2}\} +\notag\\ &E \{(x'(N-2)A'_{\sigma(N-2)}P(N-1)B_{a(N-2)}u(N-2) | \aleph_{N-2}\} +\notag\\ &E \{(u'(N-2)B_{a(N-2)}'P(N-1)A_{\sigma(N-2)}x(N-2) | \aleph_{N-2}\} +\notag\\ &E \{u'(N-2))B_{a(N-2)}'P(N-1)B_{a(N-2)}u(N-2) |\aleph_{N-2}\} \Big\} \end{align} \normalsize Let us consider each addend of the rightside of \eqref{LQRsplit2}. Since $M$ and $R$ are constant matrices, $x(N-2)$ is $\aleph_{N-2}$-measurable, and $u(N-2)$ is not a random variable since it is the input that we choose to apply to the system at time $N-2$, the first two addends can be written as \tiny \begin{align*} &E \{x'(N-2)Mx(N-2) +u'(N-2)Ru(N-2)| \aleph_{N-2}\}= \\ &x'(N-2)Mx(N-2) +u'(N-2)Ru(N-2). \end{align*} \normalsize Moreover, $x'(N-2)Mx(N-2)$ does not depend on $a(N-2), u(N-2)$ and can be moved out of the min operator. Note that $P(N-1)$ depends, according to the optimal control policy $\Omega(N-1)$, on the random variable $x(N-1)$, which in turn depends on $\sigma(N-2), x(N-2), a(N-2), u(N-2)$. As a consequence, differently from step $N-1$, computing the expected values in Equation \eqref{LQRsplit2} is non-trivial. The main idea of this proof is to overcome this difficulty, instead of exploiting the conservative approximation used in \cite{VargasCDC2010}, by considering that such expected values can assume a finite number of values. In particular, given a discrete control input $a(N-2)=a$, a linear feedback $K(N-2)=K$ and a state $x(N-2)=x$ the probability that $P(N-1) = P_{i}(N-1)$ is equal to \tiny \begin{align*} \sum\limits_{\sigma : (A_\sigma+B_a K)x \in \Omega_i(N-1)}\pi_\sigma. \end{align*} \normalsize Let $\boldsymbol{\mu} \doteq \{\mu_{\sigma}\}_{\sigma \in \{1,\ldots, q\}}$ be a vector of $q$ natural numbers $\mu_{\sigma} \in \{1,\ldots, \omega(N-1) \}$ representing all possible combinations of sets $\Omega_i(N-1)$ towards which $x(N-2)$ can be driven by the occurrence of all $\sigma \in \Sigma$. It is easy to see that, given any $\boldsymbol{\mu}$, the expected values in Equation \eqref{LQRsplit2} can be computed. In particular, the third addend can be written as \scriptsize \begin{align}\label{eqAverage1} &E \{(x'(N-2)A'_{\sigma(N-2)}P(N-1)A_{\sigma(N-2)}x(N-2) | \aleph_{N-2}\}=\notag\\ &x'(N-2) E \{A'_{\sigma(N-2)}P(N-1)A_{\sigma(N-2)}| \aleph_{N-2}\} x(N-2)=\notag\\ &x'(N-2) \left(\sum\limits_{\sigma=1}^{q} A'_\sigma P_{\mu_\sigma}(N-1) A_\sigma \pi_\sigma \right) x(N-2) \end{align} \normalsize Since $x(N-2)$ is $\aleph_{N-2}$-measurable, $P_i(N-1), i=1,\ldots,p$ are all symmetric and $\sigma(k)$ are i.i.d., the sum of the fourth and fifth addends can be written as \tiny \begin{align}\label{eqAverage2} &2E \{(x'(N-2)A'_{\sigma(N-2)}P(N-1)B_{a(N-2)}u(N-2) | \aleph_{N-2}\}=\notag\\ &=2x'(N-2)E \{ A'_{\sigma(N-2)}P(N-1)| \aleph_{N-2}\}B_{a(N-2)}u(N-2)=\notag\\ &=2x'(N-2) \left(\sum\limits_{\sigma=1}^{q} A'_\sigma P_{\mu_\sigma}(N-1) \pi_\sigma \right) B_{a(N-2)}u(N-2). \end{align} \normalsize The last addend can be written as: \tiny \begin{align}\label{eqAverage3} &E \{u'(N-2))B_{a(N-2)}'P(N-1)B_{a(N-2)}u(N-2) |\aleph_{N-2}\}=\notag\\ &u'(N-2))B_{a(N-2)}' E \{ P(N-1) |\aleph_{N-2} \} B_{a(N-2)}u(N-2)=\notag\\ &u'(N-2))B_{a(N-2)}' \left(\sum\limits_{\sigma=1}^{q} P_{\mu_\sigma}(N-1) \pi_\sigma \right) B_{a(N-2)}u(N-2). \end{align} \normalsize We can now, for all states $x(N-2)$ that are driven by each $\sigma \in \Sigma$ to the set $\Omega_{\mu_\sigma}(N-1)$, rewrite \eqref{LQRsplit2} as follows: \tiny \begin{align} \label{costo_n-2} &J(x(N-2),u(N-2),a(N-2), \boldsymbol\mu)=\notag\\ &\min\limits_{a(N-2)} \Big\{ x'(N-2)\left[M+ \left(\sum\limits_{\sigma=1}^{q} A'_\sigma P_{\mu_\sigma}(N-1) \pi_\sigma \right) \right]x(N-2)+\notag\\ &\min\limits_{u(N-2)} \Big\{ 2x'(N-2) \left(\sum\limits_{\sigma=1}^{q} A'_\sigma P_{\mu_\sigma}(N-1) \pi_\sigma \right) B_{a(N-2)}u(N-2)+\notag\\ & u'(N-2))B_{a(N-2)}' \left(\sum\limits_{\sigma=1}^{q} P_{\mu_\sigma}(N-1) \pi_\sigma \right) B_{a(N-2)}u(N-2)+\notag\\ &u'(N-2)Ru(N-2)\Big\}\Big\} \end{align} \normalsize As a consequence the optimal linear feedback strategy can be computed as in step $N-1$ by: \tiny \begin{align}\label{eqOptimalKRecursiveStep} &K_{a,\boldsymbol{\mu}}\doteq\notag\\ & -\left[R+ B_{a}' \left(\sum\limits_{\sigma=1}^{q} P_{\boldsymbol\mu_\sigma}(N-1) \pi_\sigma\right) B_{a} \right]^{-1} B_{a}' \left(\sum\limits_{\sigma=1}^{q} A'_{\sigma} P_{\boldsymbol\mu_\sigma}(N-1) \pi_\sigma\right) \bar A. \end{align} \normalsize The set of states $x(N-2)$ such that $K_{a,\boldsymbol{\mu}}$ is indeed optimal is given by \tiny \begin{align*} & \Gamma(a, \boldsymbol{\mu}) \doteq \{x \in \mathbb{R}^n : \forall \sigma \in \{1,\ldots,q\}, (A_\sigma + B_a K_{a,\boldsymbol{\mu}}) \in \Omega_{\mu_{\sigma}}(N-1)\}. \end{align*} \normalsize Given the definition of $\Omega(N-1)$ of step $N-1$, then $\Gamma(a, \boldsymbol{\mu})$ can be defined by \tiny \begin{equation*}\label{eqGammaDef} \begin{cases} x'[(A_1 + B_a K_{a,\boldsymbol{\mu}})^{-1}]'(P_{\mu_{1}}(N-1) - P_{1}(N-1))(A_1 + B_a K_{a,\boldsymbol{\mu}})^{-1}x < 0\\ \vdots\\ x'[(A_1 + B_a K_{a,\boldsymbol{\mu}})^{-1}]'(P_{\mu_{1}}(N-1) - P_{{p}}(N-1))(A_1 + B_a K_{a,\boldsymbol{\mu}})^{-1}x \leq 0\\ \vdots\\ x'[(A_q + B_a K_{a,\boldsymbol{\mu}})^{-1}]'(P_{\mu_{q}}(N-1) - P_{1}(N-1))(A_q + B_a K_{a,\boldsymbol{\mu}})^{-1}x < 0\\ \vdots\\ x'[(A_q + B_a K_{a,\boldsymbol{\mu}})^{-1}]'(P_{\mu_{q}}(N-1) - P_{{p}}(N-1))(A_q + B_a K_{a,\boldsymbol{\mu}})^{-1}x \leq 0 \end{cases} \end{equation*} \normalsize Note that, for any given $a \in A$, $\Gamma(a, \boldsymbol{\mu})$ is a subset of $\mathbb{R}^n$: its complement $\Gamma^C(a, \boldsymbol{\mu})$ can be easily defined by replacing in \eqref{eqGammaDef} $<$ and $\leq$ respectively with $\geq$ and $>$, and represents a set where the optimal linear feedback strategy cannot be computed as in \eqref{eqOptimalKRecursiveStep}. Also, for any given $a \in A$ and any $\boldsymbol{\mu}, \boldsymbol{\mu'}$, the intersection $\Gamma(a, \boldsymbol{\mu}) \cap \Gamma(a, \boldsymbol{\mu'})$ is not necessarily empty. Define now the set $\{\Omega_i\}_{i=1}^{\omega}$ of disjoint sets given by all possible combinations of intersections of sets $\Gamma(a,\boldsymbol{\mu}), a \in A, \boldsymbol{\mu}$, and such that for all $\bar a \in A$ at least a set $\Gamma(\bar a,\boldsymbol{\bar\mu})$ belongs to the intersection. As a consequence each $\Omega_i$ can be defined as a finite intersection of sets $\Gamma(a, \boldsymbol{\mu})$ and $\Gamma^C(a', \boldsymbol{\mu'})$, and can be therefore characterised by a finite set of quadratic inequalities. Consider now a generic set \tiny $$ \Omega_i = \Gamma(a_1,\boldsymbol{\mu_1}) \cap \Gamma(a_2,\boldsymbol{\mu_2}) \cap \cdots \cap \Gamma(a_z,\boldsymbol{\mu_z}) \cap \Gamma^C(a_{z+1},\boldsymbol{\mu_{z+1}}) \cap \cdots \cap \Gamma^C(a_\gamma,\boldsymbol{\mu_\gamma}). $$ \normalsize For any $x(N-2) \in \Omega_i$ we have the choice to apply a finite number of optimal control pairs $\{(a_j, K_{a_j, \mu_j})\}_{ j \in \{1,\ldots,z\}}$, each associated to the optimal cost \tiny \begin{align*} & J(x(N-2), a_j, \boldsymbol\mu_j) \doteq x'(N-2) P_{a_j, \boldsymbol\mu_j}(N-2) x(N-2). \end{align*} \normalsize To choose the optimal control feedback within $\Omega_i$ we partition it, as in step $N-1$, with a finite collection of disjoint sets $\{\Omega_{i,a,\boldsymbol\mu}\}$ defined by \tiny \begin{align*} \Omega_{i,a,\boldsymbol\mu} \doteq \{x(N-2) \in \Omega_i : a, \boldsymbol\mu = \arg\min\limits_{a,\boldsymbol\mu} J(x(N-1), a, \boldsymbol\mu) \}. \end{align*} \normalsize $\Omega_{i,a,\boldsymbol\mu}$ is the set of all states $x(N-2)$ such that the corresponding optimal control is $a^*(x(k)) = a, K^*(x(k)) = K_{a,\boldsymbol\mu}$. As a consequence $\Omega_{i,a_j,\boldsymbol\mu_j}$ can be defined as follows: \begin{equation}\label{eqPartitionRecursiveStep} \Omega_{i} \cap \begin{cases} x'(P_{a_j,\boldsymbol\mu_j}(N-1) - P_{a_1,\boldsymbol\mu_1}(N-1))x < 0\\ \vdots\\ x'(P_{a_j,\boldsymbol\mu_j}(N-1) - P_{a_{j-1},\boldsymbol\mu_{j-1}}(N-1))x < 0\\ x'(P_{a_j,\boldsymbol\mu_j}(N-1) - P_{a_{j+1},\boldsymbol\mu_{j+1}}(N-1))x \leq 0\\ \vdots\\ x'(P_{a_j,\boldsymbol\mu_j}(N-1) - P_{a_z,\boldsymbol\mu_z}(N-1))x \leq 0\\ \end{cases}, \end{equation} where the matrices are all symmetric. Note that $\{\Omega_{i,a_j,\boldsymbol\mu_j}\}_{j=1}^{z}$ is by definition a partition of $\Omega_i$. To each $\Omega_{i,a_j,\boldsymbol\mu_j}$ is associated the control $a_j$, $K_{a_j,\boldsymbol\mu_j}$ and the cost $P_{a_j,\boldsymbol\mu_j}$. Applying the same partition to each $\Omega_i$ provides the optimal solution for any state in the set $\Omega \doteq \bigcup\limits_{i,a,\boldsymbol\mu} \Omega_{i,a,\boldsymbol\mu} \subseteq \mathbb{R}^n$. The set of states $\Omega^C \doteq \mathbb{R}^n \setminus \Omega$ such that the optimal solution cannot be computed using the method above can be also defined as a finite union of sets of quadratic inequalities. To compute a suboptimal solution for states $x(N-2) \in \Omega^C(N-2)$ we can partition it in a finite number of sets $\Omega_{a,\boldsymbol\mu}^C$ as in \eqref{eqPartitionRecursiveStep} according to the set of all pairs $a, K_{a, \boldsymbol\mu}$. Of course this will not be the optimal solution, since by definition there exists at least a discrete control $a$ such that $K_{a, \mu}$ is not the corresponding optimal linear feedback. We can define $\Omega(N-2)$ by the union of all sets that partition $\Omega$ and $\Omega^C$, as defined above. $\Omega(N-2)$, together with the associated discrete controls, linear feedback gains and costs, will be provided as input to step $N-3$. Also, the set $\iota(N-2)$ can be easily characterised since only the solutions for the sets partitioning $\Omega$ are optimal. The solution at any other step $k = 1, \ldots, N-3$ given the solution at step $k+1$ can be obtained iterating the same reasoning of step $N-2$. The only difference is that a set $\Omega_{i, a, \boldsymbol\mu}$ is associated to an optimal solution only if $\Omega_{\mu_{\sigma}}(k+1)$ is associated to an optimal solution for all $\sigma \in \Sigma$. Once arrived to the initial step $N=0$, we can define the sets of initial conditions such that the strategy is optimal. This concludes the proof. $\qed$ \end{theorem} \section{Conclusion} This paper proposes a novel paradigm of networked control where the exploitation of redundancy in routing actuation data tremendously improves the control performance, by exploiting in an optimal way the advantages of different paths characterised by propagation characteristics that are at odds one another. We show that the co-design of controller and routing redundancy, given a routing that is defined a priori, strongly improves the control performance. We also provide a methodology to co-design controller and dynamic routing redundancy: note that, according to our solution, routing depends on the plant state, and it is even possible to decide not to route any actuation data for some time instants, which generates an \emph{event-triggered} control strategy to send actuation data not at all time steps, but only when necessary according to the current plant state. In future work we plan to implement a tool that applies our algorithms and to extend our methodology to more general classes of stochastic systems. Also, we will apply the methodologies in this paper to address the dynamic scheduling and routing co-design in communication protocols for wireless control systems such as WirelessHART and ISA100 (see \cite{AlurTAC11} and \cite{DInnocenzoTAC13} for details).
{ "redpajama_set_name": "RedPajamaArXiv" }
8,390
{"url":"http:\/\/openstudy.com\/updates\/55d23a96e4b0c5fe98068bc9","text":"## anonymous one year ago How do you find the limit when x is approaching 0, (x^2+3)\/x^4? @welshfella\n\n1. anonymous\n\n@Phi\n\n2. anonymous\n\n@zepdrix anyone out there\n\n3. anonymous\n\nYou could graph it and look, that's always a good place to start\n\n4. anonymous\n\n@RunawayGalaxy I honestly don't even know how to graph that.\n\n5. zepdrix\n\nso ummmmmm :)\n\n6. zepdrix\n\n$\\large\\rm \\lim_{x\\to0}\\frac{x^2+3}{x^4}$Simply plugging in 0 gives you an indeterminate form of $$\\large\\rm \\frac{3}{0}$$ ya?\n\n7. anonymous\n\n@zepdrix yes\n\n8. zepdrix\n\nDo you remember anything about this limit?$\\large\\rm \\lim_{x\\to0}\\frac{1}{x}$Because our problem is behaving the same way.\n\n9. anonymous\n\nI do not remember much about that particular limit. Would I replace x with 0? 1\/0 is undetermined?\n\n10. zepdrix\n\nWell let's plug in a value that's very close to 0, that should give us an idea of what's going on. How about 1\/99999, that's pretty close to 0 right? :)$\\large\\rm \\lim_{x\\to0}\\frac{1}{\\color{orangered}{x}}\\approx\\frac{1}{\\color{orangered}{\\frac{1}{99999}}}=1\\cdot\\frac{99999}{1}=99999$Do you understand what I did here? I plugged in a really really small fraction, a value close to zero. And applying an algebra rule, the result is giving us a really big value.\n\n11. zepdrix\n\nSo as x is getting closer to 0, 1\/x is growing infinitely large.\n\n12. anonymous\n\n@zepdrix Does L'hopital's rule not apply in this case? Is 3\/0 not indeterminate form?\n\n13. zepdrix\n\nIt's not the indeterminate form that we need for L'Hop unfortunately :( Need 0\/0 or infty\/infty\n\n14. anonymous\n\nI remembered that there were a bunch, but couldn't figure if that was one of them\n\n15. zepdrix\n\n@raesal what do you think? :d do you understand why 1\/x is blowing up large and in charge like that? :D make sense of the example?\n\n16. anonymous\n\n@zepdrix I understand the example, I just don't understand how that example is going to help me solve this problem. I don't understand how 1\/x \"blowing up large and in charge\" will help me solve this problem.\n\n17. zepdrix\n\nWell it's blowing up like, is partly explained by the fact that it's approaching the indeterminate form 1\/0. Notice that with our problem, we're approaching the indeterminate form 3\/0. So we will end up with the same result. I'm not sure of the exact algebra steps.. umm It's easier to think about it intuitively. The bottom is a 4th power, so it's doing everything \"faster\" than the top. It's getting to zero faster than the numerator, so it blows up just like 1\/x. Oh oh maybe we could do this: Multiply top and bottom by 1\/x^4$\\large\\rm \\lim_{x\\to0}\\frac{x^2+3}{x^4}\\left(\\frac{1\/x^4}{1\/x^4}\\right)=\\lim_{x\\to0}\\frac{\\frac{1}{x^2}+\\frac{3}{x^4}}{1}=\\lim_{x\\to0}\\frac{1}{x^2}+\\lim_{x\\to0}\\frac{3}{x^4}$\n\n18. zepdrix\n\nThen we can relate it back to that 1\/x limit in each of these limits,$\\large\\rm =\\left(\\lim_{x\\to0}\\frac{1}{x}\\right)^2+3\\left(\\lim_{x\\to0}\\frac{1}{x}\\right)^4$\n\n19. zepdrix\n\nThat seems wayyy tedious though :d Intuitionnnnnnn instead!\n\n20. zepdrix\n\nThat multiplication step was kinda sloppy, i shoulda just separated the fractions, x^2\/x^4 and 3\/x^4, same result.\n\n21. zepdrix\n\nI dunno, it's a lot to take in >.< Lemme know what you're thinkin\n\n22. anonymous\n\nI'm confused. I'm so sorry >.<\n\n23. zepdrix\n\nWhen you have a fraction:$\\large\\rm \\lim_{x\\to 0}\\frac{stuff}{other~stuff}$ If the stuff in the numerator is going towards 0 faster, then the fraction overall is going towards zero. It's approaching this form: $$\\large\\rm \\frac{0}{number}$$ which is just zero. When the bottom is going towards 0 faster, then the whole thing is approaching infinity. It's approaching this form: $$\\large\\rm \\frac{number}{0}$$ This second case is what is happening with our problem, the bottom is getting to zero much much faster.\n\n24. zepdrix\n\nBlah, math is hard >.<","date":"2017-01-23 02:42:54","metadata":"{\"extraction_info\": {\"found_math\": true, \"script_math_tex\": 0, \"script_math_asciimath\": 0, \"math_annotations\": 0, \"math_alttext\": 0, \"mathml\": 0, \"mathjax_tag\": 0, \"mathjax_inline_tex\": 1, \"mathjax_display_tex\": 1, \"mathjax_asciimath\": 0, \"img_math\": 0, \"codecogs_latex\": 0, \"wp_latex\": 0, \"mimetex.cgi\": 0, \"\/images\/math\/codecogs\": 0, \"mathtex.cgi\": 0, \"katex\": 0, \"math-container\": 0, \"wp-katex-eq\": 0, \"align\": 0, \"equation\": 0, \"x-ck12\": 0, \"texerror\": 0, \"math_score\": 0.8536450862884521, \"perplexity\": 1143.1809227234858}, \"config\": {\"markdown_headings\": true, \"markdown_code\": false, \"boilerplate_config\": {\"ratio_threshold\": 0.18, \"absolute_threshold\": 20, \"end_threshold\": 15, \"enable\": true}, \"remove_buttons\": true, \"remove_image_figures\": true, \"remove_link_clusters\": true, \"table_config\": {\"min_rows\": 2, \"min_cols\": 3, \"format\": \"plain\"}, \"remove_chinese\": true, \"remove_edit_buttons\": true, \"extract_latex\": true}, \"warc_path\": \"s3:\/\/commoncrawl\/crawl-data\/CC-MAIN-2017-04\/segments\/1484560281746.82\/warc\/CC-MAIN-20170116095121-00301-ip-10-171-10-70.ec2.internal.warc.gz\"}"}
null
null
{"url":"https:\/\/gmatclub.com\/forum\/what-is-the-value-of-k-198920.html","text":"GMAT Question of the Day - Daily to your Mailbox; hard ones only\n\n It is currently 19 Feb 2019, 09:05\n\nGMAT Club Daily Prep\n\nThank you for using the timer - this advanced tool can estimate your performance and suggest more practice questions. We have subscribed you to Daily Prep Questions via email.\n\nCustomized\nfor You\n\nwe will pick new questions that match your level based on your Timer History\n\nTrack\n\nevery week, we\u2019ll send you an estimated GMAT score based on your performance\n\nPractice\nPays\n\nwe will pick new questions that match your level based on your Timer History\n\nEvents & Promotions\n\nEvents & Promotions in February\nPrevNext\nSuMoTuWeThFrSa\n272829303112\n3456789\n10111213141516\n17181920212223\n242526272812\nOpen Detailed Calendar\n\u2022 Free GMAT Prep Hour\n\nFebruary 20, 2019\n\nFebruary 20, 2019\n\n08:00 PM EST\n\n09:00 PM EST\n\nStrategies and techniques for approaching featured GMAT topics. Wednesday, February 20th at 8 PM EST\n\nFebruary 21, 2019\n\nFebruary 21, 2019\n\n10:00 PM PST\n\n11:00 PM PST\n\nKick off your 2019 GMAT prep with a free 7-day boot camp that includes free online lessons, webinars, and a full GMAT course access. Limited for the first 99 registrants! Feb. 21st until the 27th.\n\nWhat is the value of K?\n\nAuthor Message\nTAGS:\n\nHide Tags\n\nMath Expert\nJoined: 02 Sep 2009\nPosts: 52971\nWhat is the value of K?\u00a0 [#permalink]\n\nShow Tags\n\n29 May 2015, 04:26\n3\n14\n00:00\n\nDifficulty:\n\n55% (hard)\n\nQuestion Stats:\n\n57% (01:18) correct 43% (01:22) wrong based on 332 sessions\n\nHideShow timer Statistics\n\nWhat is the value of K?\n\n(1) (-k)^5 = -k^5\n(2) (-k)^4 = -k^4\n\n_________________\nManager\nJoined: 21 Feb 2012\nPosts: 56\nRe: What is the value of K?\u00a0 [#permalink]\n\nShow Tags\n\n29 May 2015, 04:54\n3\n3\nHello all\n\nMy attempt:\n\nStatement 1:\n\n$$(-k)^5 = -k^5$$\n$$-k^5 = -k^5$$\nTrue for any value of $$k$$. Therefore not solvable with this statement\n\nStatement 2:\n\n$$(-k)^4 = -k^4$$\n$$k^4 = -k^4$$\n$$k^4 + k^4 = 0$$\n$$2*k^4 = 0$$\nThus $$k=0$$\nHence solvable.\n\nI will go with option $$B$$\n_________________\n\nRegards\nJ\n\nDo consider a Kudos if you find the post useful\n\nGeneral Discussion\nIntern\nJoined: 24 Apr 2015\nPosts: 20\nGMAT 1: 680 Q47 V35\nRe: What is the value of K?\u00a0 [#permalink]\n\nShow Tags\n\n29 May 2015, 16:05\nBunuel wrote:\nWhat is the value of K?\n\n(1) (-k)^5 = -k^5\n(2) (-k)^4 = -k^4\n\n1 Statement give us nothing, since K could be either positive or negative.\nTake 2 or -2 for example, the result will be the same always.\nNot Suf\n\n2 Statement 2 show us that K can not be a negative nor a positive.\ntake 2 e.g\n(-2)^4= 16\n-(2^4)=-16\nThus the only possibility is K=0\n\nCheers\nMath Expert\nJoined: 02 Sep 2009\nPosts: 52971\nRe: What is the value of K?\u00a0 [#permalink]\n\nShow Tags\n\n01 Jun 2015, 03:03\n1\n1\nBunuel wrote:\nWhat is the value of K?\n\n(1) (-k)^5 = -k^5\n(2) (-k)^4 = -k^4\n\nOFFICIAL SOLUTION:\n\nWhat is the value of K?\n\n(1) (-k)^5 = -k^5. This is the same as -k^5 = -k^5, which holds true for any value of k. Not sufficient.\n\n(2) (-k)^4 = -k^4. Since (-k)^4 = k^4, then we have that k^4 = -k^4, which gives 2k^4 = 0, or k = 0. Sufficient.\n\n_________________\nIntern\nJoined: 21 Dec 2015\nPosts: 25\nWE: Account Management (Commercial Banking)\nRe: What is the value of K?\u00a0 [#permalink]\n\nShow Tags\n\n01 Nov 2016, 08:13\nBunuel : Here,\n\n(-k)^5 = -k^5\n-k^5 + k^5 = 0.\n\nAm i missing something?\nMath Expert\nJoined: 02 Sep 2009\nPosts: 52971\nRe: What is the value of K?\u00a0 [#permalink]\n\nShow Tags\n\n01 Nov 2016, 08:16\nVishvesh88 wrote:\nBunuel : Here,\n\n(-k)^5 = -k^5\n-k^5 + k^5 = 0.\n\nAm i missing something?\n\nSo? What is the value of K? You got 0 = 0. You cannot get k from it.\n_________________\nIntern\nJoined: 21 Dec 2015\nPosts: 25\nWE: Account Management (Commercial Banking)\nRe: What is the value of K?\u00a0 [#permalink]\n\nShow Tags\n\n01 Nov 2016, 08:19\nBunuel : Thanks. Got it\nNon-Human User\nJoined: 09 Sep 2013\nPosts: 9850\nRe: What is the value of K?\u00a0 [#permalink]\n\nShow Tags\n\n18 Dec 2017, 13:07\nHello from the GMAT Club BumpBot!\n\nThanks to another GMAT Club member, I have just discovered this valuable topic, yet it had no discussion for over a year. I am now bumping it up - doing my job. I think you may find it valuable (esp those replies with Kudos).\n\nWant to see all other topics I dig out? Follow me (click follow button on profile). You will receive a summary of all topics I bump in your profile area as well as via email.\n_________________\nRe: What is the value of K? \u00a0 [#permalink] 18 Dec 2017, 13:07\nDisplay posts from previous: Sort by","date":"2019-02-19 17:05:34","metadata":"{\"extraction_info\": {\"found_math\": true, \"script_math_tex\": 0, \"script_math_asciimath\": 0, \"math_annotations\": 0, \"math_alttext\": 0, \"mathml\": 0, \"mathjax_tag\": 0, \"mathjax_inline_tex\": 0, \"mathjax_display_tex\": 1, \"mathjax_asciimath\": 0, \"img_math\": 0, \"codecogs_latex\": 0, \"wp_latex\": 0, \"mimetex.cgi\": 0, \"\/images\/math\/codecogs\": 0, \"mathtex.cgi\": 0, \"katex\": 0, \"math-container\": 0, \"wp-katex-eq\": 0, \"align\": 0, \"equation\": 0, \"x-ck12\": 0, \"texerror\": 0, \"math_score\": 0.6828452944755554, \"perplexity\": 11804.508792283803}, \"config\": {\"markdown_headings\": false, \"markdown_code\": true, \"boilerplate_config\": {\"ratio_threshold\": 0.18, \"absolute_threshold\": 10, \"end_threshold\": 15, \"enable\": true}, \"remove_buttons\": true, \"remove_image_figures\": true, \"remove_link_clusters\": true, \"table_config\": {\"min_rows\": 2, \"min_cols\": 3, \"format\": \"plain\"}, \"remove_chinese\": true, \"remove_edit_buttons\": true, \"extract_latex\": true}, \"warc_path\": \"s3:\/\/commoncrawl\/crawl-data\/CC-MAIN-2019-09\/segments\/1550247490806.45\/warc\/CC-MAIN-20190219162843-20190219184843-00279.warc.gz\"}"}
null
null
Q: Google Analytics: Spreadsheet Add-on, Invalid Segment ga:region I'm trying to get a custom report of visits by Nth week and segmented by region. The documentation says that ga:region is allowed in Segments here, but I get this error: My report setup basically looks like this: Any reason why this isn't working? A: If you are trying to segment on ga:region, you have to have it equal/not equal a value. For example, dynamic::ga:region==Oregon. Take a look at Google's documentation for segments and operators. A: ga:region isn't a segment - just include it in the Dimensions line. Segment line is for build-in and custom segments defined in your Analytics account.
{ "redpajama_set_name": "RedPajamaStackExchange" }
7,662
Saoluafata ist ein Ort an der Nordküste von Upolu in Samoa. Der Ort gehört zum Wahlbezirk (electoral constituency, Faipule District) Anoamaa East (Itu Anoamaa) im Distrikt Atua. Geographie Saoluafata liegt zusammen mit Falefa, Faleapuna und Lufilufi an einer Landzunge an der Nordküste von Upolu. Das Gebiet ist dicht besiedelt und vor der Küste schützen die Saoluafata Banks den Strand vor der Brandung. Im Ort befindet sich eine Kirche der CCCS Saoluafata. Nach Westen öffnet sich der Saluafata Harbour mit den Orten Salelesi und Fusi im Südwesten. Siehe auch Saluafata Einzelnachweise Atua Ort in Samoa
{ "redpajama_set_name": "RedPajamaWikipedia" }
6,418
\section{Introduction} \noindent Knowledge Graph (KG) is composed of triples representing facts in the form of \emph{(head entity, relation, tail entity)}, abbreviate as \emph{(h, r, t)}. KGs have proved to be useful for various AI tasks, such as semantic search~\cite{6_DBLP:conf/emnlp/BerantCFL13,7_DBLP:conf/acl/BerantL14}, information extraction~\cite{8_DBLP:conf/acl/HoffmannZLZW11,9_DBLP:conf/i-semantics/DaiberJHM13} and question answering~\cite{10_DBLP:journals/corr/ZhangLHJLW016,11_DBLP:conf/www/DiefenbachSM18}. However, it is well known that KGs are usually far from complete and this motivates many researches for KG completion, among which a common and widely used series of methods is Knowledge Graph Embedding (KGE), such as TransE \cite{14_DBLP:conf/nips/BordesUGWY13}, ComplEx \cite{12_DBLP:conf/icml/TrouillonWRGB16}, and RotatE \cite{19_DBLP:conf/iclr/SunDNT19}. To achieve better performance, as shown in Figure \ref{fig_changes}, training KGEs with higher dimension is typically preferred. But embeddings with lower dimensions provide obvious or even indispensable conveniences. The model size, i.e. the number of parameters, and the cost of reasoning time usually increase fast as the embedding dimension goes up. As shown in Figure \ref{fig_changes}, more and more little performance gain is got with larger embedding dimension, while the model size and reasoning cost keep increase linearly. \begin{figure}[] \setlength{\abovecaptionskip}{0.15cm} \setlength{\belowcaptionskip}{-0.3cm} \centering \small \subfigure[MRR and model size]{\includegraphics[width=0.236\textwidth]{ComplEx_MRR_parameters.jpg}} \subfigure[MRR and reasoning cost]{\includegraphics[width=0.236\textwidth]{ComplEx_MRR_times.jpg}} \\ \caption{The changes of performance (MRR), model size and reasoning cost along the growth of embedding dimensions on WN18RR with ComplEx.} \label{fig_changes} \end{figure} In addition, high-dimensional embeddings are impractical in many real-life scenarios. For example, a pre-trained billion-scale knowledge graph is expected to be fine-tuned to solve downstream tasks and deployed frequently at a cheaper cost. For applications with limited computing resources such as deploying KG on edge computing or mobile devices, or with limited time for reasoning such as online financial predictions, KG embedding with lower dimensions is indispensable. However, directly training a model with a small embedding size normally performs poorly as shown in Figure~\ref{fig_changes}. We propose a new research question \textbf{: is it possible to learn low-dimensional KGEs from pre-trained high-dimensional ones so that we could achieve good performance as long as faster and cheaper inference?} Knowledge Distillation~\cite{2_DBLP:journals/corr/HintonVD15} is a widely used technology to learn knowledge from a large model (teacher) to build a smaller model (student). The student learns from both the ground-truth labels and the soft labels from the teacher. In this work, we propose a novel KGE distillation metho , named \textbf{DualDE}, which is capable of distilling essence from a high-dimensional KGE into a smaller embedding size with only a little or no loss of accuracy. In DualDE, we dually distilling KGE considering the \textbf{dual-influence between the teacher and the student}: (1) the teacher's influence on the student and (2) the student's influence on the teacher. For \textit{the teacher's influence on the student}, it is well known that the soft labels output by the teacher will affect the student. While in many previous distillation works~\cite{2_DBLP:journals/corr/HintonVD15,DBLP:conf/cvpr/ParkKLC19,DBLP:conf/aaai/MirzadehFLLMG20,DBLP:conf/www/Wang0MS21}, all samples have the same hard and soft label weight, they does not distinguish the quality of soft labels of different samples from the teacher. In fact, KGE methods have different levels of mastery of different triples~\cite{19_DBLP:conf/iclr/SunDNT19}. For some triples that are difficult to be mastered by KGE methods, they usually cannot obtain reliable scores~\cite{19_DBLP:conf/iclr/SunDNT19}. Making the student imitate the teacher with unreliable scores of these difficult triples will bring negative impacts on them. To obtain a better distillation effect, we propose that the student should be able to judge the quality of the soft labels provided by the teacher and selectively learn from them, rather than treating them equally. We introduce a \textbf{soft label evaluation mechanism} into DualDE to evaluate the quality of the soft labels provided by the teacher, and adaptively assigns different soft label and hard label weights to different triples, which will retain the positive effect of high-quality soft labels and avoid the negative impact of low-quality soft labels. For \textit{the student's influence on the teacher}, it has not been study enough in previous works. Sun~\cite{5_DBLP:conf/emnlp/SunCGL19} proved that the overall performance also depends on the student's acceptance of the teacher. We hope to constantly adjust the teacher according to the student's current learning situation, so as to make the teacher more acceptable to the student and improve the final distillation result. Thus, we propose a \textbf{two-stage distillation approach} into DualDE to improve the student's acceptance of the teacher by adjusting the teacher according to the student's output. The basic idea is that although the pre-trained teacher is already strong, it may not be the most suitable one for the current student. A teacher who has a similar output distribution with the student is more conducive to the student's learning~\cite{DBLP:conf/www/Wang0MS21}. Therefore, in addition to a standard distillation stage in which the teacher is always static, we devise a second stage distillation in which the teacher is unfrozen and tries to learn from its student in reverse to become more acceptable for the student. We evaluate DualDE with several typical KGEs and standard KG datasets. Results prove the effectiveness of our method, showing that (1) the low-dimensional KGEs distilled by DualDE perform much better than the same sized KGEs directly trained and only a little or not worse than original high-dimensional KGEs; (2) the low-dimensional KGEs distilled by DualDE infer significantly faster than original high-dimensional KGEs; (3) our proposed soft label evaluation mechanism and two-stage distillation approach work well and further improve the distillation results. In summary, our contributions are three-fold: \begin{itemize \item We propose a novel framework to distill lower-dimensional KGEs from higher-dimensional ones and it achieves good performance. \item We consider the dual-influence between the teacher and the student in the distillation process, and propose a soft label evaluation mechanism to distinguish the quality of soft labels of different triples and a two-stage distillation to improve the student's adaptability to the teacher. \item We experimentally prove that our proposal can reduce embedding parameters of a high-dimensional KGE by \textbf{7-15 times} and increase the inference speed about \textbf{2-6 times} with only a little or no performance loss \end{itemize} \section{Related Work} \subsection{Knowledge Graph Embedding} In recent years, KGE technology has been rapidly developed and applied. Its key idea is to transform entities and relations of KGs into a continuous vector space as vector representations. And then the embeddings can be further applied to various KG downstream tasks. RESCAL \cite{18_DBLP:conf/icml/NickelTK11} is the first relation learning method based on tensor decomposition. To improve RESCAL, DistMult \cite{22_DBLP:journals/corr/YangYHGD14a} restricts the relation matrix to a diagonal matrix to simplify the model, ComplEx \cite{12_DBLP:conf/icml/TrouillonWRGB16} embeds entities and relations into the complex space to model asymmetric relations, and SimplE \cite{DBLP:conf/nips/Kazemi018} solves the independence problem of embedding vectors in tensor decomposition. TransE \cite{14_DBLP:conf/nips/BordesUGWY13} is the first translation-based KGE method and regards the relation as a translation from the head entity to the tail entity. And various variants of TransE have been proposed. TransH \cite{25_DBLP:conf/aaai/WangZFC14} proposes that an entity should have different representations with different relations. TransR \cite{26_DBLP:conf/aaai/LinLSLZ15} believes that different relations pay attention to different attributes of entities. TransD \cite{27_DBLP:conf/acl/JiHXL015} demonstrates that a relation may represent multiple semantics. In addition, rotation models such as RotatE \cite{19_DBLP:conf/iclr/SunDNT19}, QuatE \cite{20_DBLP:conf/nips/0007TYL19}, and DihEdral \cite{21_DBLP:conf/acl/XuL19} regard the relation as the rotation between the head and tail entity. Although the KGEs are simple and effective, there is an obvious problem that high-dimensional KGEs pose a huge challenge to storage and computing. It is necessary to reduce the dimension of KGEs and still retain a good performance for many practical application scenarios. However, there are very few researches on KGE compression. \cite{35_DBLP:conf/acl/Sachan20} proposes a method based on quantization technology to reduce the size of KGEs by representing entities as vectors of discrete codes. However, quantization cannot improve the inference speed and often increases the difficulty of model convergence \cite{DBLP:conf/iccv/GongLJLHLYY19}. MulDE~\cite{DBLP:conf/www/Wang0MS21} is the first work to apply knowledge distillation to KGE. This method transfers the knowledge from multiple teachers to a student, but it requires pre-training multiple teacher models with different KGEs. In this work, we propose an effective KGE compression method based on knowledge distillation considering the dual-influence between the teacher and the student. \vspace{-3pt} \subsection{Knowledge Distillation} In the last few years, the acceleration and compression of models have attracted a lot of research works. Common methods include network pruning \cite{32_DBLP:journals/tnn/CastellanoFP97, 33_DBLP:conf/iclr/MolchanovTKAK17}, quantification \cite{34_DBLP:conf/icml/LinTA16,35_DBLP:conf/acl/Sachan20}, parameters sharing \cite{36_DBLP:conf/iclr/DehghaniGVUK19, 37_DBLP:conf/iclr/LanCGGSS20}, and knowledge distillation \cite{2_DBLP:journals/corr/HintonVD15}. Among them, knowledge distillation (KD) has been widely used in Computer Vision and Natural Language Processing since it can effectively reduce the model size and increase the model's inference speed. Its core idea is to use the teacher's output to guide the training of the student. What's more, KD has an advantage different from the other model compression methods mentioned above: different kinds of distillation targets can be designed according to needs, providing more modeling freedom. \cite{39_DBLP:journals/corr/abs-1903-12136} proposes to distill the pre-trained language model BERT \cite{44_DBLP:conf/naacl/DevlinCLT19} into a single-layer bidirectional long and short-term memory network. \cite{5_DBLP:conf/emnlp/SunCGL19} proposes to enable students to fit the middle layer output of the teacher, instead of just the softmax layer output. \cite{38_DBLP:conf/iclr/TianKI20} believes that there are dependencies between the dimensions of data representation, and proposes maximizing the mutual information of the data representation of the student and the teacher. \cite{45_DBLP:journals/corr/abs-1909-11687} gives up the transfer of BERT's the softmax layer and directly approximates the corresponding weight matrix of the student and the teacher. \cite{DBLP:conf/cvpr/ParkKLC19} focuses on extracting the differences between samples rather than the information of a single sample itself, and proposes distance-wise loss and angle-wise distillation loss. \cite{DBLP:conf/aaai/MirzadehFLLMG20} thinks that too-large size difference between two models is harmful for the effect of distillation , and suggests using a medium-scale one to bridge this gap. However, current KD methods cannot model the dual-influence between the teacher and the student. In DualDE, for the teacher's influence on the student, we design a soft label evaluation mechanism to distinguish the quality of soft labels of different triples, and for the student's influence on the teacher, we proposed a two-stage distillation to improve the student's adaptability to the teacher. \section{Method} \begin{comment} Knowledge distillation~\cite{2_DBLP:journals/corr/HintonVD15,39_DBLP:journals/corr/abs-1903-12136,44_DBLP:conf/naacl/DevlinCLT19} typically involves two models, a larger size \emph{teacher} model with good performance and a small size \emph{student} model. During training of the student, the student is first encouraged to 1) fit the hard labels from data, like the one-hot vector of a sentence's class, with a hard labels loss, and 2) imitate the teacher's behavior via fitting soft labels from the teacher with a soft label loss. Our DualDE considers the distillation soft label loss from two aspects: the overall credibility of the triple and the embedding structure of the triple. The overall credibility of a triple is reflected by its score output by the KGE model. Generally, the higher the score the more the triple is considered to be real, and the lower the score the more it is considered wrong. The embedding structure contains the primary information ~\cite{DBLP:conf/cvpr/ParkKLC19} and captures an invariant property of the model ~\cite{DBLP:journals/jmlr/AchilleS18}. \end{comment} In this section, we introduce our KGE distillation method DualDE, in which a larger size KGE is regarded as \textit{teacher} and a small size KGE as \textit{student}. DualDE follows the typical training mechanism of knowledge distillation~\cite{2_DBLP:journals/corr/HintonVD15,39_DBLP:journals/corr/abs-1903-12136,44_DBLP:conf/naacl/DevlinCLT19} that the student is firstly encouraged to fit the hard labels from data with a hard labels loss, and then imitate the teacher via fitting soft labels from the teacher with a soft label loss. In DualDE, we make the student imitate teacher from following two aspects: overall credibility and embedding structure of target triples, since they contain the primary information~\cite{DBLP:conf/cvpr/ParkKLC19} and captures an invariant property of a model~\cite{DBLP:journals/jmlr/AchilleS18}. Different from typical knowledge distillation methods, dual-influence between the student and the teacher is fully explored in DualDE which includes teacher's influence on the student and student's influence on the teacher. For \textit{the teacher's influence on the student}, it is well known that soft labels output by the teacher will affect the student. While in many previous works~\cite{2_DBLP:journals/corr/HintonVD15,DBLP:conf/cvpr/ParkKLC19,DBLP:conf/aaai/MirzadehFLLMG20,DBLP:conf/www/Wang0MS21}, all samples have the same hard and soft label weight, and they do not distinguish the quality of soft labels of different samples from the teacher. In fact, for triples that are difficult to be mastered by KGE methods, they often cannot output reliable scores~\cite{19_DBLP:conf/iclr/SunDNT19}. Making the student imitate the teacher with unreliable scores of triples will bring negative impacts on the student. We propose that the student should be able to judge the quality of the soft labels provided by the teacher and selectively learn from them, rather than treating them equally. Thus we introduce a \textbf{soft label evaluation mechanism} into DualDE to evaluate the quality of soft labels which will retain the positive effect of high-quality soft labels and avoid the negative impact of low-quality soft labels. For \textit{the student's influence on the teacher}, it has not been studied enough in previous works. MulDE~\cite{DBLP:conf/www/Wang0MS21} pointed that the student absorbs the knowledge better from the teacher having a more similar output distribution with the student, which supports that there are suitable teachers and unsuitable teachers for the student. To make the teacher a more suitable teacher, different from previous works keeping teacher fixed all the time, we propose a \textbf{two-stage distillation approach} into DualDE. Conventional training of the student with the teacher frozen is referred to as the first stage. In the second stage, the teacher is unfrozen and adjusted according to the student's situation. The basic idea is that we not only train the teacher with a hard label to guarantee its performance, but also engage it to fit a soft label generated from the student. Essentially, this can be regarded as a process that the teacher learns from its student in reverse. As a result, the teacher will become more adaptable to the student, thereby improving the distillation effect. Overall, DualDE is trained based on following loss \begin{equation} \vspace{-2pt} \begin{aligned} &L= L_{Stu}+ \gamma L_{Tea},\\ L_{Stu} = L_{Hard}^S &+ L_{Soft}^S, \; L_{Tea} = L_{Hard}^T + L_{Soft}^T,\\ \end{aligned} \label{dis_loss_s2} \end{equation} where $\gamma=0$ in the first distillation stage, and $\gamma=1$ in the second distillation stage. Next, we elaborate on DualDE. Firstly, we define the KGE Distillation Objective. We then introduce the soft label evaluation mechanism and the two-stage distillation approach in detail. The model framework of DualDE is shown in Figure \ref{fig:model}. \begin{figure*}[] \centering \vspace{-2pt} \setlength{\belowcaptionskip}{-0.3cm} \centering \includegraphics[width=0.8\textwidth]{distileframe.png} \caption{Model framework of DualDE. \textit{SEM} refers to the soft label evaluation module. The data stream with the black arrow ``\textcolor{black}{\textbf{$\to$}}'' participates in both the first and second stages of distillation, and the data stream with the orange arrow ``\textcolor{orange}{\textbf{$\to$}}'' only participates in the second stage of distillation.} \label{fig:model} \end{figure*} \subsection{KGE Distillation Objective} Given a KG $\mathcal{K}= \{ E, R, T\} $, where $E$, $R$ and $T$ are the set of entities, relations and triples respectively. A KGE learns to express the relationships between entities in a continuous vector space. Specifically, for a triple $(h, r, t)$, where $h, t \in E$, $r \in R$, the KGE model could assign a score to it by a score function $f_r(h,t)$, to indicate the existence of $(h, r, t)$. Table \ref{t_score} summarizes the score function of some popular KGE methods. \input{T-score} \subsubsection{Hard Label Loss.} The hard label loss for the student is the original loss of the KGE method, usually a binary cross entropy loss: \begin{equation} \label{L_hard_loss} \begin{aligned} L_{Hard}^S=& -\sum_{(h,r,t)\in T\cup T^-} (y\log \sigma ( f_r^S{(h,t)}) \\ & + (1-y)(1-\log \sigma(f_r^S{(h,t)}))),\\ \end{aligned} \end{equation} where $f_r^S(h,t)$ is the score for triple $(h, r, t)$ given by the student. $\sigma$ is the Softmax function. $y$ is the ground-truth label of $(h,r,t)$, and it is $1$ for positive triple $(h, r, t)$ and $0$ for negative triple $(h^\prime, r, t^\prime)$. $(h^\prime, r, t^\prime)$ is generated by randomly replacing $h$ or $t$ in $(h,r,t)\in T$ with $h'$ or $t'$, which could be expressed as \begin{equation} \setlength{\abovedisplayskip}{0pt} \setlength{\belowdisplayskip}{10pt} \label{sample_neg} \begin{aligned} T^-=& \{(h',r,t) \notin T|h' \in E \wedge h'\ne h\} \\ & \cup \{(h,r,t') \notin T|t' \in E \wedge t'\ne t \}. \end{aligned} \end{equation} \subsubsection{Soft Label Loss} In DualDE, we enable the student to learn two kinds of knowledge from the teacher: the credibility and the embedding structure of triples. The credibility of a triple is reflected by its score output by the KGE model, and the score difference between the student and the teacher is defined as \begin{equation} \label{L_score} d_{Score}=l_{\delta}(f_{r}^{T}(h,t),f_{r}^{S}(h,t)). \end{equation} The embedding structure of a triple can be reflected by the length ratio and the angle between the embedding vectors of the head entity $h$ and tail entity $t$~\cite{DBLP:conf/cvpr/ParkKLC19}. The embedding structure difference between the teacher and the student is defined as \begin{equation} \label{loss_struc} \begin{aligned} d_{Structure}=& l_{\delta}(\varphi _{A}(h^{T},t^{T}),\varphi _{A}(h^{S},t^{S})) \\& + l_{\delta}(\varphi _{LR}(h^{T},t^{T}),\varphi _{LR}(h^{S},t^{S})), \end{aligned} \end{equation} where $f_r^T(h,t)$ ($f_r^S(h,t)$) is the score for triple $(h, r, t)$ given by the teacher (student), $\varphi _{A}(h,t)=\langle \frac{h}{\left \| h \right \|_2},\frac{t}{\left \| t \right \|_2} \rangle$ and $\varphi _{LR}(h,t)=\frac{\left \| h \right \|_2}{\left \| t \right \|_2}$, $l_{\delta}$ is Huber loss with $\delta=1$, $h^T(t^T)$ and $h^S(t^S)$ is the head (tail) entity embedding of the teacher and the student respectively, $l_{\delta}$ is Huber loss with $\delta=1$, which is defined as \begin{equation} \label{huber_loss} l_{\delta}(a,b)=\left\{\begin{matrix} \frac{1}{2}(a-b)^{2}, & \left | a-b \right |\leqslant 1,\\ \left | a-b \right |-\frac{1}{2},& \left | a-b \right |> 1. \end{matrix}\right. \end{equation} We combined the triple score difference and embedding structure difference between the student and the teacher as the soft label optimization goal: \begin{equation} d_{Soft}=d_{Score}+d_{Structure}. \end{equation} \begin{comment} And the most common expression of the final distillation loss is \begin{equation} \begin{aligned} L= (1-\alpha) L^S_{Hard} + \alpha \sum_{(h,r,t)\in T\cup T^-}d_{Soft}, \end{aligned} \label{dis_loss_v0} \end{equation} where $\alpha$ is the hyperparameter to balance hard label loss and soft label loss. Although this approach is simple, it still requires defining and adjusting the hyperparameter artificially to balance the hard label loss and the soft label loss, which increases the complexity of training. In addition, all samples have the same soft label weight and hard label weight, causing that the quality of soft labels of different samples cannot be distinguished. \end{comment} \subsection{Soft Label Evaluation Mechanism} We propose the soft label evaluation mechanism to evaluate the quality of the soft labels provided by the teacher, and adaptively assign different soft label and hard label weights to different triples, so as to retain the positive effect of high-quality soft labels and avoid the negative impact of low-quality soft labels. Theoretically, the KGE model will give higher scores to positive triples and lower scores to negative triples, but it is opposite for some triples that are difficult to be mastered by the KGE model. Specifically, if the teacher gives a high (low) score to a negative (positive) triple, which means the teacher tends to judge it as a positive (negative) triple, the soft label of this triple output by the teacher is unreliable and misleading and may have a negative impact on the student. For this triple, we need to weaken the weight of the soft label and encourage the student to learn more from the hard label. The soft label weights of the student for positive triples and negative triples are defined as Eq. (\ref{pos_soft_weight}) and Eq. (\ref{neg_soft_weight}), respectively: \begin{equation} p^S_{PosSoft}=\frac{1}{1+e^{-\alpha_1 (f_r^T(h,t)+\beta_1)}} \label{pos_soft_weight}, \end{equation} \begin{equation} p^S_{NegSoft}=1-\frac{1}{1+e^{-\alpha_2 (f_r^T(h,t)+\beta_2)}} \label{neg_soft_weight}, \end{equation} where $\alpha_1$, $\beta_1$, $\alpha_2$ and $\beta_2$ are learned from training data. The student's final soft label loss and hard label loss can be expressed as Eq. (\ref{dis_loss_stu_soft}) and Eq. (\ref{dis_loss_stu_hard}), respectively: \begin{equation} \begin{aligned} L^S_{Soft}=&\sum_{(h,r,t)\in T} p^S_{PosSoft}\cdot d_{soft} + \sum_{(h,r,t)\in T^-} p^S_{NegSoft}\cdot d_{soft}, \end{aligned} \label{dis_loss_stu_soft} \end{equation} \begin{equation} \begin{aligned} L^S_{Hard}= & \sum_{(h,r,t)\in T} (1-p^S_{PosSoft}) \cdot \log \sigma ( f_r^S{(h,t)}) \\ & + \sum_{(h,r,t)\in T^-} (1-p^S_{NegSoft}) \cdot (1-\log \sigma(f_r^S{(h,t)})). \end{aligned} \label{dis_loss_stu_hard} \end{equation} By evaluating the quality of the teacher's score for each triple, different soft label weights and hard label weights are given to different triples adaptively, helping the student selectively learn the knowledge from the teacher and get better performance. In addition, this method can balance the soft label loss and the hard label loss automatically without defining any hyperparameter manually. \subsection{Two-stage Distillation Approach} In the previous part, we introduced how to enable the student to extract knowledge from the KGE teacher, where the student is trained with hard labels and the soft labels generated by a fixed teacher. To obtain a better student, we propose a two-stage distillation approach to improve the student's acceptance of the teacher by unfreezing the teacher and engage it to learn from the student in the second stage of distillation. \subsubsection{The First Stage.} The first stage is similar to conventional knowledge distillation methods in which the teacher is frozen and unchanged when training the student. The final loss of the first stage is Eq. (\ref{dis_loss_s2}) with $\gamma=0$. \subsubsection{The Second Stage.} While adjusting the teacher in this stage, for the triples that the student does not mastered well, we also hope to reduce the negative impact of the output of the student on the teacher, and make the teacher learn more from hard labels, so as to maintain the teacher's high accuracy. Thus, we also apply the soft label evaluation mechanism in the adjustment of teacher. By evaluating the score given by the student to each triple, the weights of hard labels and soft labels for the teacher are allocated adaptively. Similarly, the soft label weights of the teacher for positive triples and negative triples are defined as Eq. (\ref{pos_soft_weight_tea}) and Eq. (\ref{neg_soft_weight_tea}), respectively: \begin{equation} p^T_{PosSoft}=\frac{1}{1+e^{-\alpha_3 (f_r^S(h,t)+\beta_3)}}, \label{pos_soft_weight_tea} \end{equation} \begin{equation} p^T_{NegSoft}=1-\frac{1}{1+e^{-\alpha_4 (f_r^S(h,t)+\beta_4)}}, \label{neg_soft_weight_tea} \end{equation} where $\alpha_3$, $\beta_3$, $\alpha_4$ and $\beta_4$ are learned from training data. The teacher's final soft label loss and hard label loss can be expressed as Eq. (\ref{dis_loss_tea_soft}) and Eq. (\ref{dis_loss_tea_hard}), respectively: \begin{equation} \begin{aligned} L^T_{Soft}=&\sum_{(h,r,t)\in T} p^T_{PosSoft}\cdot d_{soft} + \sum_{(h,r,t)\in T^-} p^T_{NegSoft}\cdot d_{soft}, \end{aligned} \label{dis_loss_tea_soft} \end{equation} \begin{equation} \begin{aligned} L^T_{Hard}= &\sum_{(h,r,t)\in T} (1-p^T_{PosSoft}) \cdot \log \sigma ( f_r^T{(h,t)}) \\ & + \sum_{(h,r,t)\in T^-} (1-p^T_{NegSoft}) \cdot (1-\log \sigma(f_r^T{(h,t)})). \end{aligned} \label{dis_loss_tea_hard} \end{equation} The final loss of the second stage is Eq. (\ref{dis_loss_s2}) with $\gamma=1$. \begin{comment} \section{Method} This section elaborates on our proposal DualDE. Firstly, we define the KGE Distillation Objective. We then introduce the soft label evaluation mechanism and the two-stage distillation approach. The model framework of DualDE is shown in Figure \ref{fig:model}. \subsection{KGE Distillation Objective} \label{subsubsection:DSKGE} Knowledge distillation typically involves two models, a larger size \emph{teacher} model with good performance and a small size \emph{student} model. During training of the student, the student is first encouraged to 1) fit the hard labels from data, like the one-hot vector of a sentence's class, with a hard labels loss, and 2) imitate the teacher's behavior via fitting soft labels from the teacher with a soft label loss. Our soft label losses include triple score loss and embedding structure loss. Given a KG $\mathcal{K}= \{ E, R, T\} $, where $E$, $R$ and $T$ are the set of entities, relations and triples respectively. A KGE learns to express the relationships between entities in a continuous vector space. Specifically, for a triple $(h, r, t)$, where $h, t \in E$, $r \in R$, the KGE model could assign a score to it by a score function $f_r(h,t)$, to indicate the existence of $(h, r, t)$. Table \ref{t_score} summarizes the score function of some popular KGE methods. \input{T-score} \subsubsection{Hard Label Loss.} The hard label loss for student is the original loss of the KGE method, usually a binary cross entropy loss: \begin{equation} \label{L_hard_loss} \begin{aligned} L_{Hard}^S=& -\sum_{(h,r,t)\in T\cup T^-} (y\log \sigma ( f_r^S{(h,t)}) \\ & + (1-y)(1-\log \sigma(f_r^S{(h,t)}))),\\ \end{aligned} \end{equation} where $f_r^S(h,t)$ is the score for triple $(h, r, t)$ given by the student. $\sigma$ is the Softmax function. $y$ is the ground-truth label of $(h,r,t)$, and it is $1$ for positive triple $(h, r, t)$ and $0$ for negative triple $(h^\prime, r, t^\prime)$. $(h^\prime, r, t^\prime)$ is generated by randomly replacing $h$ or $t$ in $(h,r,t)\in T$ with $h'$ or $t'$, which could be expressed as \begin{equation} \setlength{\abovedisplayskip}{0pt} \setlength{\belowdisplayskip}{10pt} \label{sample_neg} \begin{aligned} T^-=& \{(h',r,t) \notin T|h' \in E \wedge h'\ne h\} \\ & \cup \{(h,r,t') \notin T|t' \in E \wedge t'\ne t \}. \end{aligned} \end{equation} \subsubsection{Soft Label Loss} In DualDE, we enable the student to learn two kinds of knowledge from the teacher: the credibility and the embedding structure of triples. The credibility of a triple is reflected by its score output by the KGE model. With the teacher's triple score, the student can understand to what extent does the teacher trust a triple. Generally, the higher the score, the more the triple is considered to be real, and the lower the score the more it is considered wrong. We engage the student to fit itself to the teacher by minimizing the difference between these two scores, which is defined as \begin{equation} \setlength{\abovedisplayskip}{-5pt} \setlength{\belowdisplayskip}{5pt} \label{L_score} d_{Score}=l_{\delta}(f_{r}^{T}(h,t),f_{r}^{S}(h,t)), \end{equation} where $f_r^T(h,t)$ is the score for triple $(h, r, t)$ given by the teacher. $l_{\delta}$ is Huber loss with $\delta=1$, which is defined as \begin{equation} \setlength{\abovedisplayskip}{6pt} \setlength{\belowdisplayskip}{6pt} \label{huber_loss} l_{\delta}(a,b)=\left\{\begin{matrix} \frac{1}{2}(a-b)^{2}, & \left | a-b \right |\leqslant 1,\\ \left | a-b \right |-\frac{1}{2},& \left | a-b \right |> 1. \end{matrix}\right. \end{equation} The embedding structure contains the primary information ~\cite{DBLP:conf/cvpr/ParkKLC19} and captures an invariant property of the model ~\cite{DBLP:journals/jmlr/AchilleS18}. Inspired by RKD~\cite{DBLP:conf/cvpr/ParkKLC19}, we use the length ratio and the angle between the embedding vectors of the head entity $h$ and tail entity $t$ to reflect the embedding structure of a triple. And the embedding structure difference between the teacher and the student is defined as \begin{equation} \label{loss_struc} \begin{aligned} d_{Structure}=& l_{\delta}(\varphi _{A}(h^{T},t^{T}),\varphi _{A}(h^{S},t^{S})) \\& + l_{\delta}(\varphi _{LR}(h^{T},t^{T}),\varphi _{LR}(h^{S},t^{S})), \end{aligned} \end{equation} where $\varphi _{A}(h,t)=\langle \frac{h}{\left \| h \right \|_2},\frac{t}{\left \| t \right \|_2} \rangle$ and $\varphi _{LR}(h,t)=\frac{\left \| h \right \|_2}{\left \| t \right \|_2}$, $l_{\delta}$ is Huber loss with $\delta=1$, $h^T(t^T)$ and $h^S(t^S)$ is the head (tail) entity embedding of the teacher and the student respectively. Here we impose no extra constraint on the embedding of $r$ since there are often far more entities than relations in a KG and no extra constraint on $r$ make the student still maintain a certain degree of free exploration ability. We combined the triple score difference and embedding structure difference between the student and the teacher as the soft label optimization goal for the student: \begin{equation} d_{Soft}=d_{Score}+d_{Structure}. \end{equation} And the most common expression of the final distillation loss is \begin{equation} \begin{aligned} L= (1-\alpha) L^S_{Hard} + \alpha \sum_{(h,r,t)\in T\cup T^-}d_{Soft}, \end{aligned} \label{dis_loss_v0} \end{equation} where $\alpha$ is the hyperparameter to balance hard label loss and soft label loss. Although this approach is simple, it still requires defining and adjusting the hyperparameter artificially to balance the hard label loss and the soft label loss, which increases the complexity of training. In addition, all samples have the same soft label weight and hard label weight, causing that the quality of soft labels of different samples cannot be distinguished. \subsection{Soft Label Evaluation Mechanism} The score of a triple given by the KGE model reflects the overall credibility of the triplet, which represents the degree of mastery of the triple by the model~\cite{19_DBLP:conf/iclr/SunDNT19}. Theoretically, the KGE model will give a higher score to positive triples and a lower score to negative triples, but it is the opposite for some triples that are difficult to be mastered by the KGE model. The teacher's mastery of a triplet will affect the quality of the soft label it gives. The lower the teacher's mastery of a triple, the lower the credibility of the soft label of the triple given by the teacher. Specifically, if the teacher gives a higher (lower) score to a negative (positive) triple, that is, the teacher model tends to judge it as a positive (negative) triple, the teacher's mastery of this triple is not enough, and the soft label of this triple output by the teacher is misleading and may have a negative impact on the student. For this triple, we need to weaken the weight of the soft label and encourage the student to learn more from the hard label. Therefore, the soft label weights of the student for positive triples and negative triples are defined as Eq. (\ref{pos_soft_weight}) and Eq. (\ref{neg_soft_weight}), respectively, \begin{equation} p^S_{PosSoft}=\frac{1}{1+e^{-\alpha_1 (f_r^T(h,t)+\beta_1)}} \label{pos_soft_weight} \end{equation} \begin{equation} p^S_{NegSoft}=1-\frac{1}{1+e^{-\alpha_2 (f_r^T(h,t)+\beta_2)}} \label{neg_soft_weight} \end{equation} where $\alpha_1$, $\beta_1$, $\alpha_2$ and $\beta_2$ are learned from training data. The student's final distillation loss in Eq. (\ref{dis_loss_v0}) can be rewritten as \begin{equation} \begin{aligned} L_{Stu}=&\sum_{(h,r,t)\in T} p^S_{PosSoft}\cdot d_{soft} + \sum_{(h,r,t)\in T^-} p^S_{NegSoft}\cdot d_{soft} \\ & + \sum_{(h,r,t)\in T} (1-p^S_{PosSoft}) \cdot \log \sigma ( f_r^S{(h,t)}) \\ & + \sum_{(h,r,t)\in T^-} (1-p^S_{NegSoft}) \cdot (1-\log \sigma(f_r^S{(h,t)})). \end{aligned} \label{dis_loss_v1} \end{equation} By evaluating the quality of the teacher's score for each triple, different soft label weights and hard label weights are given to different triples adaptively, so as to help the student selectively learn the knowledge from the teacher and get better performance. In addition, this method can balance the soft label loss and the hard label loss automatically without defining any hyperparameter manually. \subsection{Two-stage Distillation Approach} In the previous part, we introduced how to enable the student to extract knowledge from the KGE teacher, where the student is trained with hard labels and the soft labels generated by a fixed teacher. To obtain a better student, we propose a two-stage distillation approach to improve the student's acceptance of the teacher by unfreezing the teacher and engage it to learn from the student in the second stage of distillation. \subsubsection{The First Stage.} The first stage similar to conventional knowledge distillation methods in which the teacher is frozen and unchanged when training the student as introduced in the previous section, and the whole training loss is equivalent to Eq. (\ref{dis_loss_v1}). \subsubsection{The Second Stage.} MulDE~\cite{DBLP:conf/www/Wang0MS21} pointed that the teacher to generate soft labels having a similar distribution with the student's output helps the student absorb the knowledge from the teacher better. Thus, in the second stage, the teacher is unfrozen and tries to adjust itself to improve the acceptance for the student. The basic idea is that we not only train the teacher with a hard label to guarantee its performance, but also engage it to fit a soft label generated from the student. Essentially, this can be regarded as a process where the teacher also learns from its student in reverse. As a result, the teacher will become more adaptable to the student, thereby improving the distillation effect. While adjusting the teacher, for those triples that the student does not mastered well, we also hope to reduce the negative impact of the output of the student on the teacher, and make the teacher learn more from hard labels, so as to maintain the teacher's high accuracy. Thus, we also apply the soft label evaluation mechanism in the adjustment of teacher. By evaluating the scores given by the student to each triple, the weights of hard labels and soft labels for the teacher are allocated adaptively. Similarly, the soft label weights of the teacher for positive triples and negative triples are defined as Eq. (\ref{pos_soft_weight_tea}) and Eq. (\ref{neg_soft_weight_tea}), respectively, \begin{equation} p^T_{PosSoft}=\frac{1}{1+e^{-\alpha_3 (f_r^S(h,t)+\beta_3)}} \label{pos_soft_weight_tea} \end{equation} \begin{equation} p^T_{NegSoft}=1-\frac{1}{1+e^{-\alpha_4 (f_r^S(h,t)+\beta_4)}} \label{neg_soft_weight_tea} \end{equation} where $\alpha_3$, $\beta_3$, $\alpha_4$ and $\beta_4$ are learned from training data. The loss for adjusting the teacher is \begin{equation} \begin{aligned} L_{Tea}=&\sum_{(h,r,t)\in T} p^T_{PosSoft}\cdot d_{soft} + \sum_{(h,r,t)\in T^-} p^T_{NegSoft}\cdot d_{soft} \\ & + \sum_{(h,r,t)\in T} (1-p^T_{PosSoft}) \cdot \log \sigma ( f_r^T{(h,t)}) \\ & + \sum_{(h,r,t)\in T^-} (1-p^T_{NegSoft}) \cdot (1-\log \sigma(f_r^T{(h,t)})). \end{aligned} \label{dis_loss_v2_tea} \end{equation} Therefore, the whole training loss of the second stage is \begin{equation} L=L_{Stu}+L_{Tea}. \label{dis_loss_v2} \end{equation} \end{comment} \section{Experiments} We evaluate DualDE on typical KGE benchmarks, and are particularly interested in the following questions: \begin{itemize \item Is DualDE capable of distilling a good low-dimensional student from the high-dimensional teacher and performing better than the same dimensional model trained from scratch without distillation or using other KD methods? \item How much is the inference time improved after distillation? \item Do the soft label evaluation mechanism and two-stage distillation approach contribute to our proposal and how much? \end{itemize} \subsection{Datasets and Implementation Details} \subsubsection{Datasets.} We experiment on two common knowledge graph completion benchmark datasets WN18RR \cite{16_DBLP:conf/emnlp/ToutanovaCPPCG15} and FB15k-237 \cite{15_DBLP:conf/aaai/DettmersMS018}, subsets of WordNet \cite{14_DBLP:conf/nips/BordesUGWY13} and Freebase \cite{14_DBLP:conf/nips/BordesUGWY13} with redundant inverse relations eliminated. Table~\ref{table_dataset} shows the statistics of these two datasets. \input{dataset} \subsubsection{Evaluation Metrics.} We adopt standard metrics MRR, and Hit@$k$ $(k=1,3,10)$. Given a test triple $(h, r, t)$, we first replace the head entity $h$ with each entity $e \in E$ and generate candidate triples $(e, r, t)$. Then we use the score function $f_r(e,t)$ to calculate the scores of all candidate triples and arrange them in descending order, according to which, we obtain the rank of $(h,r,t)$, $rank_{h}$ as its head prediction result. For $(h,r,t)$'s tail prediction, we replace $t$ with all $e \in E$ to generate candidate triples $(h, r, e)$, and get the tail prediction rank $rank_{t}$ in a similar way. We average $rank_{h}$ and $rank_{t}$ as the final rank of $(h, r, t)$. Finally, we calculate MRR, and Hit@$k$ via the rank of all test triples. MRR is their mean reciprocal rank. And Hit@$k$ measures the percentage of test triples with rank $\le k$. We use the filtered setting \cite{14_DBLP:conf/nips/BordesUGWY13} by removing all triples in the candidate set that existing in training, validating, and testing sets. \input{T-WN18RR} \input{T-FB15K237} \subsubsection{Baselines.} We implement DualDE by employing four commonly used KGE models, including TransE \cite{14_DBLP:conf/nips/BordesUGWY13}, ComplEx \cite{12_DBLP:conf/icml/TrouillonWRGB16}, SimplE \cite{DBLP:conf/nips/Kazemi018} and RotatE \cite{19_DBLP:conf/iclr/SunDNT19}. In addition to the directly trained student of required dimension without distillation (no-DS), \begin{itemize} \item BKD \cite{2_DBLP:journals/corr/HintonVD15} is the most basic and commonly used KD method. We use BKD by minimizing the KL divergence of the triple score distributions output by the teacher and student. \item RKD \cite{DBLP:conf/cvpr/ParkKLC19} is a typical embedding-based approach, focusing on the structural differences between samples. In the experiment, we jointly use the distance-wise and angle-wise distillation losses proposed in the original paper. \item TA~\cite{DBLP:conf/aaai/MirzadehFLLMG20} proposes a medium-scale network (Teaching Assistant) to bridge the gap between the two models. We choose the best TA size recommended by the authors, whose MRR is closest to the average MRR of the teacher and the student. \item MulDE~\cite{DBLP:conf/www/Wang0MS21} is the first work to apply KD technology to KGE, which proposes to transfer the knowledge from multiple teachers to a student. Since there is a big framework gap between MulDE which is based on multiple teachers and DualDE which is based on a single teacher, it is difficult to directly apply MulDE to the above 4 KGE methods and compare it with DualDE. To compare with MulDE fairly and reasonably, we modified DualDE to a multi-teacher framework similar to MulDE, called M-DualDE. Specifically, M-DualDE retains the same structure of four 64-dimensional teachers and one 32-dimensional student as MulDE, and uses the same KGE models as in MulDE. The difference is that M-DualDE replaces the three distillation strategies proposed in MulDE with our soft label evaluation mechanism and two-stage distillation approach, and finally calculates the weighted average of the soft labels from four teachers as the final soft label of the student according to the conventional method in multi-teacher distillation~\cite{DBLP:conf/icassp/WuCW19}. \end{itemize} The other experimental details of the baselines including hyperparameter settings are the same as their original papers. \subsubsection{Implementation Details.} We implement DualDE by extending OpenKE \cite{DBLP:conf/emnlp/HanCLLLSL18}, an open-source KGE framework based on PyTorch. We set embedding dimension $d_{teacher}= \{256, 512, 1024\}$, $d_{student}=\{128, 64, 32, 16\}$, and make $d_{teacher} = 512$, $d_{student}=\{64, 32\}$ for primary experiment. We set batch size to $1024$ and maximum training epoch to $3000$. For each positive triple, we generate $64$ negative ones for WN18RR and $25$ for FB15k-237 in each training epoch. We choose Adam~\cite{49_DBLP:journals/corr/KingmaB14} as the optimizer, and learning rate decay and trigger decay threshold is set to $0.96$ and $10$. We perform a search on the initial learning rate in $\{0.0001,0.0005,0.001,0.01\}$ and report the results from the best one. \subsection{Q1: Does our method successfully distill a good student? } To verify whether DualDE successfully distills a good student, we first train a student with only hard label loss, marked as `no-DS', which is the same as training a same dimensional original KGE model. We also train same dimensional students using DualDE and other KD methods. We compare them on link prediction. Table \ref{T-WN18RR} and \ref{T-FB15k-237} shows the results on WN18RR and FB15k-237 of 32-dimensional and 64-dimensional students with 512-dimensional teachers. \subsubsection{Results Analysis.} First we analyze the results on WN18RR in Table~\ref{T-WN18RR}. Table~\ref{T-WN18RR} shows that the performance of `no-DS' model decreases significantly as the embedding dimension reducing. For SimplE, compared with the 512-dimensional teacher, a 32-dimensional `no-DS' model only achieves $64.8\%$, $66.1\%$, and $47.8\%$ results on MRR, Hit@3, and Hit@1. And for ComplEx, the MRR decreases from $0.433$ to $0.268$ ($38.1\%$). This illustrates that directly training low dimensional KGEs produces poor results. Compared with `no-DS', DualDE greatly improves the performance of 32-dimensional students. The MRR of TransE, SimplE, ComplEx and RotatE on WN18RR improves from $0.164$ to $0.21$ ($28.0\%$), from $0.273$ to $0.384$ ($40.7\%$), from $0.268$ to $0.397$ ($48.1\%$), and from $0.421$ to $0.468$ ($11.2\%$). On the basis of `no-DS', our 32-dimensional students achieve an \textbf{average improvement of} $\textbf{32.0\%}$, $\textbf{23.0\%}$, $\textbf{33.9\%}$, and $\textbf{46.7\%}$ on MRR, Hit@10, Hit@3, and Hit@1 among these four KGEs, finally reaching an \textbf{average level of} $\textbf{92.9\%}$, $\textbf{94.8\%}$, $\textbf{93.1\%}$, and $\textbf{102.3\%}$ of teacher's results on MRR, Hit@10, Hit@3, and Hit@1. We can also observe a similar result on FB15k-237 in Table~\ref{T-FB15k-237}. The results show that DualDE can achieve \textbf{16 times} (512:32) embedding compression rate (CR) while retaining most of the performance of the teacher (more than $90\%$), in spite of some performance loss, which is still much better than training a low-dimensional model directly without any distillation. More importantly, DualDE helps 64-dimensional students achieve almost the same good performance as the 512-dimensional teachers. Take WN18RR for instance, our 64-dimensional student with RotatE achieves $99.0\%$, $98.8\%$, $98.0\%$, and $100.0\%$ results of the teacher on MRR, Hit@10, Hit@3, and Hit@1. And among these four KGEs, our 64-dimensional students achieve an \textbf{average level of} $\textbf{98.2\%}$, $\textbf{99.2\%}$, $\textbf{98.6\%}$, and $\textbf{103.0\%}$ of teacher's results on MRR, Hit@10, Hit@3, and Hit@1. A similar phenomenon could be found on FB15k-237 in Table~\ref{T-FB15k-237}, and particularly for ComplEx, the MRR, Hit@10, Hit@3 and Hit@1 of DualDE ($0.303$, $0.478$, $0.334$ and $0.218$) even surpass the teacher's ($0.298$, $0.472$, $0.327$ and $0.213$). The results show that DualDE can achieve \textbf{8 times} (512:64) embedding CR with very little or even no performance loss. In addition, compared with different KD methods including BKD, RKD, TA (Table~\ref{T-WN18RR} and~\ref{T-FB15k-237}), and MulDE (Table~\ref{T-MulDE}), DualDE achieves the best performance in almost all settings. \input{T-MulDE} \subsubsection{More Different Dimensional Teachers and Students.} To further evaluate our DualDE with more different dimensions, we also conduct experiments on 256-dimensional and 1024-dimensional teachers and 16-dimensional and 128-dimensional students. Figure \ref{HeatMap_transe_mrr} shows a heatmap of MRR results with TransE on WN18RR. It shows that (1) for 128-dimensional students, the higher dimensional teacher achieve slightly better results; (2) for 64-dimensional students, the higher-dimensional teacher does not necessarily achieve better results; and (3) for 32-dimensional and 16-dimensional students, the higher-dimensional teacher achieves worse results. This indicates that our method's best compression capability is about 8 times. An intuition is that although a bigger teacher is more expressive, an overly high compression ratio may prevent the teacher from transferring important knowledge to the student. This analysis reveals that for an application where an especially low-dimensional student is required and suppose the required dimension is $d$, instead of choosing a very high-dimensional teacher with fantastic performance, \textbf{it is better to choose a teacher with dimension $\le 8\times d$}, which helps obtain a better student and save more pretraining costs. \begin{figure}[!hbpt] \centering \setlength{\belowcaptionskip}{-0.2cm} \centering \includegraphics[width=0.3\textwidth]{HeatMap_transe_mrr.jpg} \caption{Students' test MRR distilled by teachers with different dimensions on the WN18RR with TransE.} \label{HeatMap_transe_mrr} \vspace{-0.05in} \end{figure} \subsection{Q2: Does the distilled student accelerate inference speed and how much?} To test the inference speed, we conduct link prediction experiments on 93,003 samples from WN18RR and 310,116 samples from FB15k-237. Since the inference speed is not affected by the prediction mode (head or tail prediction), we uniformly compare the tail prediction time. The inference is performed on a single Tesla-V100 GPU, and the test batch size is set to the total number of entities: 40,943 for WN18RR and 14,541 for FB15k-237. To avoid accidental factors, we repeat the experiment 3 times and report the average time. Table~\ref{table_lp_efficiency} shows the result of inference time cost (in units of seconds). \input{T-reference-time} It shows that our distilled student greatly accelerates the inference speed. Take ComplEx and RotatE as examples, the inference time of the 512-dimensional teachers on WN18RR is $7.03$ times and $7.81$ times of the 32-dimensional student. Compared with the teachers, the 64-dimensional students achieve \textbf{an average speed increase of 2.25$\times$, 2.22$\times$, 3.66$ \times$, and 3.98$ \times$}, and the 32-dimensional students achieve \textbf{an average speed increase of 3.11$\times$, 3.35$\times$, 5.90$\times$, and 5.76$\times$} for TransE, SimplE, ComplEx and RotatE among the two datasets Previous experiments have proved that compared with the 512-dimensional teachers, our 64-dimensional students (8 times embedding CR) have little or no performance loss, and our 32-dimensional students (16 times embedding CR) retain most of performance. The results support that DualDE successfully reduces \textbf{7-15 times} embedding parameters and increase the inference speed by \textbf{2-6 times}. \subsection{Q3: Do the soft label evaluation mechanism and two-stage distillation approach contribute and how much?} We conducted a series of ablation studies to evaluate the impact of the two proposed strategies of DualDE: the soft label evaluation mechanism and the two-stage distillation approach. First, to study the impact of the soft label evaluation mechanism, we compare our method (DS) to that with removing the soft label evaluation mechanism (\emph{-SEM}). Then, to study the impact of the two-stage distillation approach, we compare DS to that with removing the first stage (\emph{-S1}) and removing the second stage (\emph{-S2}). Table~\ref{two-stage} summarizes the MRR and Hit@10 results on WN18RR. \input{T-two-stage} After removing \emph{SEM} (refer to -\emph{SEM}), all students' performance declines compared to DS. Among these four KGEs, the MRR and Hit@10 of 64-dimensional students drop by an average of $3.7\%$ and $2.8\%$, and the MRR and Hit@10 of 32-dimensional students drop by an average of $7.9\%$ and $5.4\%$. The results show that the soft label evaluation module, which evaluates the quality of the soft label for each triple and assigns different soft label and hard label weight to different triples, is indeed beneficial to the student model to master those difficult triples and get better performance. After removing \emph{S1} with only \emph{S2} preserved (refer to -\emph{S1}), the performance is overall lower than DS. Presumably, the reason is that both the teacher and the student will adapt to each other in \emph{S2}. With a randomly initialized student, the student conveys mostly useless information to the teacher which may be misleading and will crash the teacher. In addition, the performance of `\emph{-S1}' is very unstable. With `\emph{-S1}' setting, 64-dimensional students obtain results only slightly worse than DS, while 32-dimensional students perform obviously very poor. For the 32-dimensional student of SimplE, the MRR and Hit@10 of `\emph{-S1}' drop by $21.4\%$ and $10.6\%$ compared with DS. This is even worse than using the most basic distillation method BKD, showing that the first stage is necessary for DualDE. After removing \emph{S2} with only \emph{S1} preserved (refer to -\emph{S2}), the performance decreases in almost all setting. Compared with DS, the MRR of 64- and 32-dimensional students of `-\emph{S2}' decreased by an average of $2.4\%$ and $3.8\%$ among these four KGEs, indicating that the second stage can indeed make teacher and student adapt to each other, and further improve the result. These results support the effectiveness of our two-stage distillation that first train the student in \emph{S1} converging to a certain performance and then co-optimize the teacher and student in \emph{S2}. \section{Conclusion and Future Work} Too many embedding parameters of the knowledge graph will bring huge storage and calculation challenges to actual application scenarios. In this work, we propose a novel KGE distillation method DualDE to compress KGEs into the lower-dimensional space to effectively transfer the knowledge of the teacher to the student. Considering the dual-influence between the teacher and the student, we propose two distillation strategies into DualDE: the soft label evaluation mechanism to adaptively assign different soft label and hard label weights to different triples and the two-stage distillation approach to enhance the student's acceptance of the teacher by encouraging them learn from each other. We have evaluated DualDE through link prediction task on several KGEs and benchmark datasets. Results show that our method can effectively reduce the embedding parameters and greatly improve the inference speed of a high-dimensional KGE with only a little or no performance loss. In this work, we only consider KGE distillation from the perspective of a single modal, that is graph structure information of KG encoded by KGE methods. In the future, we would like to first explore the KGE distillation with multi-modal data, such as combining the graph structure information and the text (or image) information of the entity to further improve the performance of low-dimensional KGEs. \begin{acks} This work is funded by NSFC91846204/U19B2027, national key research program 2018YFB1402800. \end{acks} \newpage \bibliographystyle{unsrt}
{ "redpajama_set_name": "RedPajamaArXiv" }
7,219
Federal Budget a cynical mess: Greens This budget is a cynical attempt to buy votes instead of planning for the nation's looming challenges. What we needed was a plan to tackle the climate emergency through a real investment in renewables and a managed transition away from coal and other fossil fuels. What we needed was a plan to tackle growing inequality and to fund our essential services. Instead Scott Morrison and Josh Frydenberg have stuck their heads in the sand and delivered a few election bribes. Statement on Christchurch terror attacks I offer my deepest sympathies to the New Zealand Muslim community in the wake of today's senseless right wing terrorist attack in Christchurch. I extend these sympathies to Muslims in Australia and indeed around the world. My heart aches with yours on this dark and terrible day. We must unite, as one community, against the plague of hatred and violence that is ricocheting around the world. Silence is not an option. This is a time for us to call out racism and islamophobia in all its forms, and the politicians and media commentators who enable it. Greens announce $5.8b dental policy $5.8 billion would be invested in providing Medicare-funded dental care in a policy announced today by Leader of the Australian Greens Dr Richard Di Natale and Greens candidate for Macnamara Steph Hodgins-May. "Your health shouldn't be determined by your postcode or bank balance," said Dr Di Natale, a former GP and public health specialist. Greens announce Julian Burnside as candidate for Kooyong Richard Di Natale 5 Mar 2019 Julian Burnside AO QC will stand for the Greens in the electorate of Kooyong at the upcoming federal election, said Leader of the Australian Greens Dr Richard Di Natale. "I'm so excited to be able to announce that Julian Burnside is running as a candidate for the Greens in Kooyong. It's going to be a tough contest, no question, but we're in with a real shot now," said Senator Di Natale. "This Government has been an absolute disaster and no one personifies their absolute failure to take meaningful action on climate change and refugees like Josh Frydenberg. ERF funding better spent on coal communities Richard Di Natale 26 Feb 2019 Scott Morrison's Emissions Reduction Fund is nothing more than a rort designed to funnel taxpayers' money to his big coal mates and the funding would be better spent helping coal communities to transition, said Leader of the Australian Greens Dr Richard Di Natale. "Coal is the world's biggest driver of climate change and Australia is the world's biggest exporter of coal. Without a plan to shift away from coal, this government has no plan to fight climate change, "said Senator Di Natale. Shorten capitulates on Medevac Bill "Just when you begin to hope that the Labor Party was starting to find a backbone on refugees, Bill Shorten has gone to water," said Australian Greens Leader, Dr Richard Di Natale. "Despite his Deputy saying the Government's policy to transfer sick patients to Christmas island for treatment was 'difficult to understand' and his Immigration spokesperson saying the reopening the centre was 'silly', Bill Shorten thinks it's 'fine'. Banking Royal Commission report a small step towards the reform we deserve Richard Di Natale 4 Feb 2019 Today's disappointing final report into the banking and financial services industry will slow, but not end decades of money grabbing and unethical conduct, the Australian Greens have said today. "The enthusiasm from the Liberal and Labor parties to accept these recommendations tells you all you need to know. The financial services industry is one of the biggest donors to both old parties, and they will all be laughing all the way to the bank tonight," Leader of the Australian Greens Senator Richard Di Natale said. Statement on the Murray Darling Basin Royal Commission Water and Murray Darling Basin Today we've seen the SA Murray Darling Basin Royal Commission deliver a stinging indictment of a plan that has become a multi-billion dollar environmental disaster for our nation. The Murray Darling is our nation's food bowl. The river is central to Aboriginal culture. It has outstanding environmental significance and is a key water source for South Australia - including many regional towns and cities.
{ "redpajama_set_name": "RedPajamaCommonCrawl" }
7,402
\section{Safety Case Template for Object Detection} \label{sec:safetycase} In this section, we describe in detail, the claims, decomposition strategies and sources of evidence for the argument in \mdl{\mbox{$C$}}. Fig.~\ref{fig:sct} shows the rendering of the proposed safety case template for component \mbox{$C$}~in GSN. Claims are expressed using \emph{Goal} nodes, decompositions of claims into sub-claims as \emph{Strategy} nodes and evidence as \emph{Solution} nodes. In addition, \emph{Context} and \emph{Assumption} nodes denote supporting information. We exploit the modularity and templating features in GSN to encapsulate the template argument in module \mdl{\mbox{$C$}} and treat the top-level goal \clm{\mbox{$C$}} as an \emph{away-goal}---i.e., referenced from within the main ADS argument \mdl{ADS}. While details of \mdl{ADS} and \mdl{\mbox{$C$}-unit} are left unspecified and are out of scope for this paper, we highlight aspects of them that \mdl{\mbox{$C$}} depends on. Overall, the argument takes a formal deductive approach in which claims are expressed as bounded probabilities and strategies mathematically relate the bounds between child and parent claims. The top claim for component \mbox{$C$}~is decomposed using HMPs corresponding to system-level hazards that have misperceptions as causes. Each claim for a single HMP is then factorized into crash rate, misperception rate, and occurrence of hazardous ADS dynamics (HBSS), plus a guarantee that all hazardous misperceptions in the HBSS are covered. Among these goals, misperception rate is further decomposed by perception-only (PO) conditions, separating the misperception rate for each PO condition, and PO occurrence. Finally, the misperception rate for each PO condition is decomposed into frame misperception patterns which define risk-aware performance metrics that can be estimated via testing in the machine learning context. \begin{figure*} \centering \includegraphics[width=.85\textwidth]{images/sct.pdf} \caption{Proposed safety case template for argument in \mdl{\mbox{$C$}} using GSN.} \label{fig:sct} \end{figure*} \subsection{Goal \clm{\mbox{$C$}}} The template assumes a single type of high severity event, which we term ``crash'' throughout this paper. In Sec.~\ref{sec:severity} we discuss how to adapt the template to allow for multiple severity levels. The top-level claim, that component \mbox{$C$}~is adequately safe, is formalized by bounding the probability \mbox{$P_C$}$(\name{MCrash})$ that the ADS reaches a crash state due to a misperception by component \mbox{$C$}~in performing task $T$. Note that we take an assume-guarantee view of \mdl{\mbox{$C$}}, where claim \clm{\mbox{$C$}} is guaranteed (up to the evidence) only if we assume all other ADS components are operating as designed (\ass{Sys}). This assumption can be adjusted to accommodate different system considerations. Fig.~\ref{fig:s-mp} helps explain the meaning of \clm{\mbox{$C$}}. Subset \mbox{$D_{\scriptsize{\name{MCrash}}}$}~are drives that contain hazardous misperceptions in carrying out task $T$. Subset \mbox{$D_C$}~are drives that are possible when component \mbox{$C$}~implements $T$. Component \mbox{$C$}~may not produce some hazardous misperceptions, and other misperceptions it produces may be benign; thus, it is the occurrence of drives in the intersection \mbox{$D_{\scriptsize{\name{MCrash}}}$}$\cap$\mbox{$D_C$}~(bright red) that the claim \clm{\mbox{$C$}} seeks to bound to an acceptable level. Safer components have a smaller value for \mbox{$P_C$}$(\name{MCrash})$, and if the current component \mbox{$C$}~does not meet the required target level, different mitigation steps could be taken. For example, \mbox{$C$}~could be replaced with a better component \mbox{$C$}$'$ that makes fewer hazardous misperceptions, an ensemble of components can be used jointly to reduce hazardous misperceptions using redundancy, etc. \begin{figure}[!t] \centering \includegraphics[width=0.40\textwidth]{images/s-mp_cropped.pdf} \vspace{0in} \caption{Decomposition of \clm{\mbox{$C$}} into sub-claims by decomposing \mbox{$D_{\scriptsize{\name{MCrash}}}$}~into subsets corresponding to hazardous misperception patterns.} \label{fig:s-mp} \vspace{0in} \end{figure} \subsection{Strategy \stg{HMP}} It is unrealistic to expect to provide evidence directly for \clm{\mbox{$C$}} since this covers all possible misperception-caused crashes. The similar complexity issue in the main ADS argument is addressed by decomposing the safety claim based on system hazards that may occur. For a system hazard that can be caused by hazardous misperceptions, we can define a corresponding HMP. The strategy \stg{HMP} exploits this use of system hazards to decompose \mbox{$D_{\scriptsize{\name{MCrash}}}$}~ and, correspondingly, \clm{\mbox{$C$}} into subclaims using HMPs. In Fig.~\ref{fig:sct}, \stg{HMP} is linked to context information about the ADS hazard analysis and creates sub-claims \clm{HMP$_i$} for the corresponding identified hazardous misperception patterns. In addition, it includes the sub-claim \clm{Res}, which corresponds to the residual hazardous misperception-caused drives not covered by any HMP. \begin{figure} \centering \vspace{.1in} \includegraphics[width=0.44\textwidth]{images/hmp_cropped.pdf} \caption{Illustration of how an HMP can be used to classify cases of misperception-caused crashes.} \vspace{-0.1in} \label{fig:hmp} \end{figure} In order to simplify the relationship between bounds, we assume that the HMPs are chosen so that the subsets of drives they define are disjoint. We show below that it is always possible to satisfy this restriction. With this, the simple additive relationship $\gamma_{\scriptsize{\mbox{$C$}}}\ge\gamma_{res}+\Sigma_i\gamma_i$ holds among the sub-claims. This allows the bound on \mbox{$P_C$}$(\name{MCrash})$ to be conveniently seen as a ``risk budget'' that is allocated to different HMPs and helps to study risk trade-offs. \subsection{Goal \clm{HMP$_i$}} Def.~\ref{def:hmp} defines an HMP as a drive specification in terms of \name{HBSS} and \name{MP} conditions. Fig.~\ref{fig:s-mp} shows an example subset of drives $D_{\text{HMP}_i}$ that satisfy the specification for one HMP$_i$. The corresponding sub-claim \clm{HMP$_i$} bounds the occurrence of drives in the subset $D_{\text{HMP}_i}\cap$\mbox{$D_C$}~--- i.e. the drives in {HMP}$_i$ that could be produced when component \mbox{$C$}~is used. As discussed above, we assume that HMPs identify disjoint sets of drives. This is always possible to achieve by constructing additional HMPs corresponding to overlaps. For example, if HMP$_i$ and HMP$_j$ overlap, we define HMP$_{i,j} \equiv\tuple{\name{HBSS}_i \wedge \name{HBSS}_j, \name{MP}_i \vee \name{MP}_j}$ and redefine HMP$_{i} \equiv \tuple{\name{HBSS}_i \wedge \neg \name{HBSS}_j, \name{MP}_i}$ and HMP$_{j} \equiv \tuple{\neg\name{HBSS}_i \wedge \name{HBSS}_j, \name{MP}_j}$. \subsection{Goal \clm{Res} and Solution \sol{Res}} Claim \clm{Res} bounds the occurrence of hazardous misperceptions in drives not covered by any HMP---those in the residual subset $(\mbox{$D_{\scriptsize{\name{MCrash}}}$}\cap\mbox{$D_C$})\setminus\bigcup_i D_{\text{HMP}_i}$ in Fig.~\ref{fig:s-mp}. Since, the HBSSs are based on system-level hazards, the evidence for claim \clm{Res} should be drawn from evidence in argument \mdl{ADS} regarding completeness of hazard analysis. We identify \sol{Res} as an away-solution to indicate this fact. \subsection{Strategy \stg{HMP$_i$-Struct}} Fig.~\ref{fig:hmp} shows how an HMP is related to a misperception-caused crash state. The crash state $s_t$ occurs because the drive preceding it was an HBSS drive, and within this, an MP misperception sequence caused a hazardous behaviour. Given this fact and Def.~\ref{def:hmp}, $\mbox{$P_C$}(\name{MCrash}\wedge \name{HMP}_i)$ can be expressed as the product of three terms using the chain rule for joint probabilities: \begin{enumerate} \item Misperception-caused crash rate \begin{itemize} \item $\mbox{$P_C$}(s_t\in\name{MCrash}|\exists d\in \mathcal{D}\cdot \name{HBSS}_i(d)\wedge \name{End}(d)=s_t \wedge \exists d'\in\mathcal{D}\cdot\name{MP}_i(d')\wedge d'\subseteq d)$ \item Probability a state is a misperception-caused crash given it ends an $\name{HBSS}_i$ drive containing an $\name{MP}_i$ sequence. \item Shorthand: $\mbox{$P_C$}(\name{MCrash}|\name{HBSS}_i,\name{MP}_i)$ \end{itemize} \item Misperception rate \begin{itemize} \item $\mbox{$P_C$}(\exists d'\in\mathcal{D}\cdot\name{MP}_i(d')\wedge d'\subseteq d|d \in \mathcal{D}\wedge \name{HBSS}_i(d) \wedge \name{End}(d)=s_t)$ \item Given a state ends an $\name{HBSS}_i$ drive, the probability the state is preceded by an $\name{MP}_i$ sequence contained within the drive. \item Shorthand: $\mbox{$P_C$}(\name{MP}_i|\name{HBSS}_i)$ \end{itemize} \item Exposure of HBSS in ODD \begin{itemize} \item $\mbox{$P_C$}(\exists d\in \mathcal{D}\cdot \name{HBSS}_i(d)\wedge \name{End}(d)=s_t)$ \item The probability that a state ends an $\name{HBSS}_i$ drive. \item Shorthand: $\mbox{$P_C$}(\name{HBSS}_i)$ \end{itemize} \end{enumerate} These three terms produce the sub-claims \clm{MP$_i$-CR}, \clm{MP$_i$-MR} and \clm{HBSS$_i$}, respectively. Thus, we have that $\gamma_i \ge \gamma_{i,\scriptsize{\name{CR}}}\gamma_{i,\scriptsize{\name{MR}}}\gamma_{i,\scriptsize{\name{HBSS}}}$. In Fig.~\ref{fig:sct} the shorthand forms of the probabilities are used. The fourth sub-claim, \clm{MP$_i$-N}, is needed to show that $\name{MP}_i$ covers all hazardous misperceptions in $\name{HBSS}_i$. \subsection{Goal \clm{MP$_i$-N} and Solution \sol{MP$_i$-N}} By Def.~\ref{def:hmp}, $\name{MP}_i$ must identify all hazardous misperceptions that component \mbox{$C$}~could produce in an $\name{HBSS}_i$ drive. In Fig.~\ref{fig:s-mp}, this is equivalent to the condition $(\mbox{$D_{\scriptsize{\name{MCrash}}}$}\cap\mbox{$D_C$}\cap D_{\scriptsize{\name{HBSS}_i}})\subseteq (D_{\scriptsize{\name{MP}_i}}\cap\mbox{$D_C$}\cap D_{\scriptsize{\name{HBSS}_i}})$. Claim \clm{MP$_i$-N} states this by saying that an $\name{HBSS}_i$ drive not containing an $\name{MP}_i$ misperception sequence has probability zero of ending in a crash. Strong evidence for this claim may require safety analysis methods such as FTA and FMEA (or its specializations, e.g., CFMEA~\cite{salay2019safety}). Empirical evidence could be obtained by simulating randomly sampled \name{HBSS}$_i$ drives and checking that those that end in a crash also satisfy \name{MP}$_i$. \subsection{Goal \clm{MP$_i$-CR} and Solution \sol{MP$_i$-CR}}\label{sec:mp-i-s} The crash rate is the probability that a drive in HMP$_i$ ends in a crash. The \name{HBSS}$_i$ condition alone only guarantees that a misperception-caused hazardous behaviour is \emph{possible} in the drive, but doesn't guarantee one occurs. The condition \name{MP}$_i$ in HMP$_i$ constrains \name{HBSS}$_i$ to drives that contain misperceptions. When \name{MP}$_i$ is sufficiently constraining so that the only misperceptions that satisfy it are hazardous (i.e., no benign misperceptions), then a crash is guaranteed, and thus $\mbox{$P_C$}(\name{MCrash}|\name{HBSS}_i,\name{MP}_i)=1$. This is desirable because allowing benign misperceptions into HMP$_i$ forces the bound $\gamma_{i}$ to be less tight than necessary. However, allowing benign misperceptions does not pose a safety risk. Empirical evidence to check or estimate $\gamma_{i,\scriptsize{\name{CR}}}$ could be obtained by simulating randomly sampled \name{HBSS}$_i$ drives with randomly injected \name{MP}$_i$ misperceptions and counting the number that end in a crash. \subsection{Goal \clm{HBSS$_i$} and Solution \sol{HBSS$_i$}} The claim in this goal bounds the occurrence of \name{HBSS}$_i$ drives in the ODD. In the context of ISO 26262 and SOTIF, this is related to the level of \emph{exposure} to the \name{HBSS}$_i$ scenario by the ADS. Since exposure to HBSS$_i$ is the same as the exposure to the corresponding system-level hazard it is based on, the exposure level and evidence should already be found in argument \mdl{ADS}. Thus, the \sol{HBSS$_i$} is identifies as an away-solution node. Although this claim uses distribution \mbox{$P_C$}~specific to component \mbox{$C$}, in practice, changing the component should not affect the exposure. The exposure level would only be dependent on a specific choice of \mbox{$C$}~if the ADS explicitly accounted for the weaknesses of \mbox{$C$}~in its driving policy. For example, if the object detector being used was known to perform poorly on busy roads, the ADS policy could be designed to avoid them, thus affecting exposure levels. \subsection{Goal \clm{MP$_i$-MR}} The misperception rate is the key sub-claim of the decomposition \stg{HMP$_i$-Struct} that is affected by the behaviour of component \mbox{$C$}; thus, it is the focal point of any development effort to improve safety by changing \mbox{$C$}. However, estimating the bound $\gamma_{i,\text{MR}}$ directly may be difficult. Since the development goal for component \mbox{$C$}~is to make it perform well in the ODD, \name{MP}$_{i}$ misperceptions may not be produced by \mbox{$C$}~in the majority of \name{HBSS}$_{i}$ drives, making this a rare event and challenging for collecting empirical evidence. However, it is well known that perception performance can be dramatically affected by external conditions such as weather, lighting, object properties such as shape, color and size, spatial configurations of objects, etc. We refer to these as \emph{Perception-Only (PO)} conditions since they identify sub-cases within \name{HBSS}$_{i}$ with higher probability of \name{MP}$_{i}$ misperceptions but do not constrain ADS behaviours. Distinguising HBSS from MP and PO conditions allows a separation of analysis of ADS dynamics (i.e., planning and actuation) from perception. In a similar spirit to hazard analysis at the higher levels of the safety case, we decompose the claim \clm{MP$_i$-MR} according to PO conditions. \subsection{Strategy \stg{MP$_i$-PO}} Let $\{\name{PO}_{i,j}\}_j$ be a set of PO conditions for HMP$_i$. PO conditions are drive predicates that further ``condition'' the drives within $D_{\scriptsize{\name{HBSS}_i}}$ in Fig.~\ref{fig:s-mp} by constraining drive factors that affect the occurrence of misperceptions. Because it does not constrain ADS behaviour, the occurrence of $\name{PO}_{i,j}$ is assumed to be independent of $\name{HBSS}_i$. For example, the occurrence of different lighting conditions is independent of the occurrence of the left-turn scenario defined by $\name{HBSS}_{\name{IL}}$. We further assume that PO conditions define disjoint subsets of drives within $D_{\scriptsize{\name{HBSS}_i}}$. Finally, we define $\name{PO}_{i,\scriptsize{\name{Nom}}}=\neg\bigvee_{j\neq \scriptsize{\name{Nom}}}\name{PO}_{i,j}$ as the distinguished PO condition representing the nominal case of drives where no other PO condition holds. Based on these assumptions and by the law of total probability, we have: \begin{multline}\label{eqn:po} \mbox{$P_C$}(\name{MP}_i|\name{HBSS}_i)= \sum_j \mbox{$P_C$}(\name{MP}_i|\name{HBSS}_i,\name{PO}_{i,j})\mbox{$P_C$}(\name{PO}_{i,j}) \end{multline} The sub-claims \clm{PO$_{i,j}$-MR} and \clm{PO$_{i,j}$} correspond to the terms in the summation in Eqn~\ref{eqn:po} and denote the conditioned misperception rate and occurrence of the PO condition, respectively. Thus the relationship between bounds is: $\gamma_{i,\scriptsize{\name{MR}}}\ge \sum_j \gamma_{i,j,\scriptsize{\name{MR}}}\gamma_{i,j,\scriptsize{\name{PO}}\uparrow}$. The effectiveness of this decomposition strategy depends on whether we can select a set $\{\name{PO}_{i,j}\}_j$ of conditions that well cover the categories of external triggers for hazardous misperceptions defined by \name{MP}$_i$. One way to achieve this is to base the set of PO conditions on a safety analysis method such as CV-HAZOP~\cite{kuwajima2019open,zendel2015cv}. CV-HAZOP defines a systematic method of exhaustively identifying modes of interference with a computer vision (CV) process by first modeling the CV process, and then using guide words in the spirit of HAZOP to identify how the process can be disturbed. The resultant list of interference modes can then be filtered and aggregated based on the specifics of the CV task~\cite{zendel2017analyzing}, ODD, HBSS and MP conditions to produce a specifically applicable PO set. A similar strategy could be used to analyze any perceptual task. \subsection{Goal \clm{PO$_{i,j}$} and Solution \sol{PO$_{i,j}$}} The claim in this goal bounds the occurrence of ADS drives in the ODD that exhibit the condition \name{PO}$_{i,j}$. Here we require both upper and lower bounds to allow us to use the following for the nominal case: $\mbox{$P_C$}(\name{PO}_{i,\scriptsize{\name{Nom}}})=1-\sum_{j\neq \scriptsize{\name{Nom}}}\mbox{$P_C$}(\name{PO}_{i,j})\le 1-\sum_{j \neq \scriptsize{\name{Nom}}}\gamma_{i,j,\scriptsize{\name{PO}}\downarrow}$. As with \clm{HBSS$_i$}, it may be reasonable to assume that the occurrence of these conditions are independent of the specifics of the ADS design and choice of component \mbox{$C$}; thus, the bounds $\gamma_{i,j,\scriptsize{\name{PO}}\downarrow}$ and $\gamma_{i,j,\scriptsize{\name{PO}}\uparrow}$ could be based on generic empirical or analytical sources of data. For example, information on precipitation frequency, visibility and sunlight variation may be sourced from weather bureaus, the frequency of different vehicle colors and shapes could come from vehicle sales statistics, etc. An important additional consideration is that the occurrence of these conditions may vary based on the geography in which the ADS will operate. \subsection{Goal \clm{PO$_{i,j}$-MR}} This claim bounds the rate of $\name{MP}_i$ misperceptions within the context of a particular PO condition. Estimating the bound $\gamma_{i,j,\text{MR}}$ directly is difficult since \name{MP}$_i$ is a condition on \emph{sequences} of misperceptions, but component \mbox{$C$}~only operates at the single frame level producing individual misperceptions. Thus, there is a need to link these two levels of representation of misperceptions. The solution is to decompose the probability of \name{MP}$_i$ with respect to the probabilities of its constituent frame misperception patterns. \subsection{Strategy \stg{PO$_{i,j}$-FMP}} The condition \name{MP}$_i$ is expressed in terms of a set $\{\name{FMP}_{i,k}\}_k$ of frame misperception patterns. For each $\name{FMP}_{i,k}$, a sub-claim \clm{FMP$_{i,j,k}$-MR} is created. In addition, we specify a \emph{linking expression} $F_{i,j}$, given in context node \ctx{Link$_{i,j}$}, that bounds the probability of \name{MP}$_i$ in terms of the probabilities of $\{\name{FMP}_{i,k}\}_k$. Although the set $\{\name{FMP}_{i,k}\}_k$ is fixed for a given \name{MP}$_i$, the linking expression can vary depending on condition \name{PO}$_j$ because this can affect relationship between probabilities. For this reason, $F_{i,j}$ depends on both indices $i$ and $j$. For example, in the HMP \name{IL} the misperception pattern of repeated frame mis-localization events can cause an incorrect speed estimate of the on-coming vehicle leading to a hazardous left turn. If a sequence of mis-localization events are caused by interference from precipitation, then each event can be considered to be independent in the context of precipitation PO condition. However, if the mis-localizations are caused by the reflectance characteristics of the on-coming car's surface (i.e., reflectance PO condition), then the events are not independent because the reflectance problem will continue to occur in all events. \subsection{Goal \clm{FMP$_{i,j,k}$-MR}} Since each $\name{FMP}_{i,k}$ is defined over individual frames, the claim for \clm{FMP$_{i,j,k}$-MR} uses the distribution $P_{C,fr}$ of frames rather than the distribution \mbox{$P_C$}~of states in ADS drives. However, the probability is still conditional, restricted to frames occurring during drives satisfying \name{HBSS}$_i$ and \name{PO}$_i$. Note that different HMPs may share reliance on the same frame misperception patterns. For example, the FMP $\name{FN}_{20}$, representing FNs within 20 meters of the ego vehicle, may be used in definitions of different MP conditions. However, even if in HMP$_i$ and HMP$_{i'}$, $\name{FMP}_{i,k}=\name{FMP}_{i',k'}=\name{FN}_{20}$, the goals \clm{FMP$_{i,j,k}$-MR} and \clm{FMP$_{i',j',k'}$-MR} that bound its occurrence remain distinct because they depend on different HBSS and PO conditions. A key contribution of the safety case template is that the set of claims $\{$\clm{FMP$_{i,j,k}$-MR}$\}_{i,j,k}$ can be seen to define a set of \emph{risk-aware performance metrics} for evaluating a component \mbox{$C$}~implementing task $T$: \begin{mydefinition}[Risk-aware Performance Metric] Given test dataset \name{TDS}$_{i,j}=\{(x_l,y_l)\}_{l}$ drawn from conditional distribution $P_{C,fr}((x,y)|\name{HBSS}_i,\name{PO}_{i,j})$, a \emph{risk-aware performance metric} $m_{i,j,k}$ for component $C$ is defined as: $$m_{i,j,k}=\frac{1}{|\name{TDS}_{i,j}|}\sum_{(x,y)\in \name{TDS}_{i,j}}\mathbf{1}[C(x)\notin \name{FMP}_{i,k}(y)] $$ \end{mydefinition} Metric $m_{i,j,k}$ is a \emph{performance} metric because it computes a measure of the misperceptions produced by $C$. It is \emph{risk-aware} because it only counts hazardous misperceptions and ignores benign ones. Unlike ``generic'' performance metrics typically used for evaluating perception components (e.g., recall, mAP, AuPR) that count any deviation from ground truth as bad, here only deviations that satisfy $\name{FMP}_{i,k}$ are considered bad. Furthermore, $\name{FMP}_{i,k}$ is derived from, and is traceable to, safety claims about $C$ via the safety case template. Finally, another benefit is that each metric $m_{i,j,k}$ focuses on a different system hazard and perception context (via HBSS $i$ and PO $j$) and a different aspect of the performance of $C$ (via FMP $k$), allowing a more fine-grained tuning of how $C$ impacts system safety. Goal \clm{FMP$_{i,j,k}$-MR} is a unit-level claim on the performance of component $C$; thus, it is expressed as an away-goal that links to module \mdl{$C$-unit}. While the full details of this argument are beyond the scope of this paper\footnote{See the recent related work discussed in the introduction for approaches to the argument in \mdl{$C$-unit}.}, the metric $m_{i,j,k}$ can be used as part of a black-box testing argument since, from a statistically standpoint, it is a sample estimate of $P_{C,fr}(\name{FMP}_{i,k}|\name{HBSS}_i,\name{PO}_{i,j})$. To use $m_{i,j,k}$ to compute $\gamma_{i,j,k}$ we need to take into account the sampling error of this estimate with sample size $N=|$\name{TDS}$_{i,j}|$. The sampling distribution is binomial but can be approximated with a Normal distribution when $N>30$. Then the upper bound $\sigma_q$ of the $q\%$ confidence interval on the error of $m_{i,j,k}$ is given by $$\sigma_q=z(q)\sqrt{\frac{m_{i,j,k}(1-m_{i,j,k})}{N}}$$ Where, $z(q)$ is the $\frac{100+q}{200}$ quantile of the standard normal distribution. For example, if $q=99$ then $z(q)=2.58$. Then we can define $\gamma_{i,j,k}=m_{i,j,k}+\sigma_q$. This bound assumes that $\name{TDS}_{i,j}$ is a representative sample and data adequacy arguments in \mdl{$C$-unit} are applicable here. \section{Conclusion and Future Work} \label{sec:conclusion} In this paper, we address a gap in the research on safety cases for automated driving and ML by proposing a template safety argument linking the system-level arguments and unit-level arguments. The template provides a formal claim decomposition approach tailored to perception and identifies a set of risk-aware safety metrics that can be used to evaluate perception components. We demonstrate the applicability of the template through a detailed case study. As part of future work, we explore several directions. First, the issue of \emph{confidence} needs special consideration. It is well known that the strength of an argument is dependent on the level of confidence in claims generated by the evidence and there is much research on defining and propagating confidence within an argument. We have addressed this using confidence intervals in some claims but it requires a more systematic treatment throughout the template. Second, while underlying methodology for identifying HMPs and PO conditions is suggested in various claims, this needs comprehensive elaboration. Third, we currently specify a single linking expression for connecting MP conditions to their constituent frame misperception patterns but it is clear that the expression depends also on other factors. For example, in the case study, we assume independence between occurrences of \mbox{\name{FNA}} s. This is appropriate for ``typical'' cars but for cars that are unusual, it is likely that if there is one \mbox{\name{FNA}}, then all detections will be \mbox{\name{FNA}}, so the independence assumption is not valid. Finally, we intend to do a detailed feasibility study of the approach and identify places it can be improved with the hope that eventually it can be adopted into industrial practice. \section{Applying template \mdl{\mbox{$C$}}}\label{sec:discussion} In this section, we discuss various topics related to the use of the the safety case template. \subsection{Accommodating multiple severity levels}\label{sec:severity} The template is designed for a single high severity event (i.e., crash); however, typically safety cases address multiple severity levels (e.g., four severity levels in ISO 26262). A simple and flexible way to do this is to create multiple \emph{parallel} arguments by adding an implicit parameter $L$ to the template representing $N$ severity levels. Then each GSN node can be interpreted as an array of $N$ nodes corresponding to the severity levels. For example, goal \clm{PO$_{i,j}$-MR} is interpreted as $\mbox{$P_C$}(\name{MP}_i[L]|\name{HBSS}_i[L],\name{PO}_{i,j}[L])\le\gamma_{i,j,\scriptsize{\name{MR}}}[L]$ allowing the definitions of conditions \name{MP}$_i$, \name{HBSS}$_i$, \name{PO}$_{i,j}$ and bound $\gamma_{i,j,\scriptsize{\name{MR}}}$ to be qualified by severity level. When a condition or bound is not dependent on severity, the severity parameter need not be considered in the definition. For example, in the HBSS for HMP \name{IL}, the severity of the hazardous behaviour of turning left when the on-coming vehicle is too close varies depending on the speed of the on-coming vehicle. Thus, \name{HBSS}$_{\name{IL}}[L]$ represents a version of the HBSS condition with a different speed depending on $L$. Correspondingly, in \name{MP}$_{\name{IL}}[L]$ the number of required $\name{FN}_{20}$ misperceptions may reduce with increasing speed. However, if \name{MP}$_{\name{IL}}$ represents misperceptions of a direct speed measurement (e.g., via Radar) then it would not be dependent on $L$. \subsection{Top-down vs. bottom-up development}\label{sec:use} The template takes a formal deductive approach by using the decompositional structure of the argument to express bound $\gamma_{\scriptsize{{\mbox{$C$}}}}$ in the top-level claim in terms of similar bounds in lower level claims. The mathematical relationship between bounds given in each strategy defines formal traceability from every lower-level claim to the top-level claim. The formal traceability allows $\gamma_{\scriptsize{{\mbox{$C$}}}}$ to be interpreted in either of two ways: i) as a \emph{safety target} that component \mbox{$C$}~must achieve, or, ii) as a conservative (i.e, upper bounding) estimate of the probability \mbox{$P_C$}$(\name{MCrash})$ based on its sub-claims. Interpretation (i) supports a top-down development strategy in which a safety target from the main ADS argument \mdl{ADS} is systematically allocated to different sub-claims to define component level requirements for \mdl{\mbox{$C$}-unit}. Interpretation (ii) supports a bottom-up development strategy in which confidence about leaf claims (as expressed by the bounds on these) are correctly propagated upward to \mdl{ADS}. This can be used to guide development effort on the component by identifying which HMPs, FMPs, and PO conditions contribute the most to risk. \subsection{Iterative and continuous development} Developing a safety case is costly, thus any iteration regarding a component that impacts its safety case must incur a cost. However, ML-based perception components may be frequently re-trained as new useful training samples become identified or when domain shift occurs. In addition, some development methods, such as active learning, require multiple re-training. The proposed safety case template has the beneficial property that it largely independent of the particular choice of component \mbox{$C$}. The structure (i.e., choice of claims) is determined by perception task $T$ and is independent of \mbox{$C$}. The only claims that are directly affected by \mbox{$C$}~are \clm{FMP$_{i,j,k}$-MR} because the bounds $\gamma_{i,j,k}$ must be recomputed or rechecked when \mbox{$C$}~changes (although, the test datasets $\name{TDS}_{i,j}$ are independent of \mbox{$C$}). The bounds for higher claims can be automatically recomputed from these. Thus, the impact of iterating \mbox{$C$}~is well localized to limit the safety case change cost. \section{Case Study}\label{sec:casestudy} In this section, we demonstrate the instantiation of the safety case template for an object detection task \name{OD} and define the claims associated with one HMP in detail---HMP \name{SCA}~(``stopped car ahead''). The component implementing the task \name{OD} is \name{PoPi}, the Point Pillars object detector for LiDAR point clouds \cite{lang2019pointpillars}. Knowing the internal details of \name{PoPi}~is not needed for understanding this case study. The ODD we assume consists of driving conditions represented in the KITTI object detection dataset~\cite{geiger2012we}, which is naturalistic, summer, clear weather, day-time driving in a small city (based on Karlsruhe, Germany). The ADS we used in which \name{PoPi}~operates has the following details relevant to the case study: \begin{itemize} \item In the perception pipeline, the output of \name{PoPi}~feeds a \emph{Tracker} component that maintains a model of past and predicted (near future) trajectories of all relevant road users. It takes $n_{trk}=9$ consecutively missed frames by \name{PoPi}~for tracker to lose the track of an object. \item The comfortable and maximum (i.e., emergency) braking rate capable by the ego vehicle are $a_{b,comf}=2.01\, m/s^2$ and $a_{b,emerg}=2.86\,m/s^2$, respectively. The maximum acceleration is $a_{max}=3.02\, m/s^2$. Maximum speed is $11.11\,m/s$ ($40\,km/h$). \item The frame rate for task \name{OD} is $10\,f/s$ \end{itemize} We use FOL to sketch formal definitions throughout this section. \subsection{Goal \clm{\name{PoPi}}} The task \name{OD} is defined by ground truth function $\name{OD}:X\to Y$ where $X$ are LiDAR point clouds and $Y$ are sets of bounding boxes classified as car, pedestrian or cyclist. Component \name{PoPi}~implementing \name{OD} defines function $\name{PoPi}:X\to Y$ and may deviate from \name{OD} resulting in FNs and FPs. Fig.~\ref{fig:misper} shows two examples in the context of a hazardous frame misperception pattern \mbox{\name{FNA}}~defined below. The objective of the claim in this goal is to show that the occurrence of hazardous misperceptions by \name{PoPi}~is bounded to an acceptable level $\gamma_{\mbox{\scriptsize{\name{PoPi}}}}$ as determined by the main ADS argument \mdl{ADS}. \subsection{Strategy \stg{HMP}} In this example, we are only considering the HMP \name{SCA}. \subsection{Goal \clm{HMP$_{\mbox{\scriptsize{\name{SCA}}}}$}}\label{sec:hmpsca} We assume that, in the hazard analysis used by the main ADS argument, the following hazardous operational situation is identified: the ego vehicle, gets close enough to a stopped car ahead, such that, unless braking is applied by the ego vehicle a crash (i.e., collision with stopped vehicle) will result. Thus, any \emph{braking interruption} of sufficient time length to cause an accident is a hazardous behaviour of the ADS in this situation. This system-level hazard could have different causes including slippery roads and malfunctioning brakes but since a misperception in performing \name{OD} can also be a cause, we create the HMP \name{SCA} $=\tuple{\name{HBSS}_{\mbox{\scriptsize{\name{SCA}}}}, \name{MP}_{\mbox{\scriptsize{\name{SCA}}}}}$ to represent this case within argument \mdl{\name{PoPi}}. To define \name{HBSS}$_{\mbox{\scriptsize{\name{SCA}}}}$, we assume the following safe driving policy: a stopped vehicle should be detected sufficiently far ahead to allow the ego vehicle, braking comfortably, to stop at a stand-still distance of 4m from it. In addition, based on simple physics-based modeling we observe that if the ego vehicle is travelling at speed $v$, it must brake with at least $a_b$ to avoid a collision with a stopped vehicle distance $x = \frac{v^2}{2a_{b}}$ ahead. \begin{mydefinition} [$\name{HBSS}_{\mbox{\scriptsize{\name{SCA}}}}(d)$] For all drives $d\in \mathcal{D}$, $\name{HBSS}_{\mbox{\scriptsize{\name{SCA}}}}(d)$ iff there is a stopped vehicle $x_{sc} = \frac{v^2_{init}}{2a_{b,comf}}+4$ meters ahead of the ego vehicle and the ego speed in state $d[1]$ is $v_{init}>0$. \end{mydefinition} Thus, $\name{HBSS}_{\mbox{\scriptsize{\name{SCA}}}}(d)$ then, under normal operation, the ego vehicle stops safely. However, if there is a braking interruption, it will need to compensate by braking more intensely (up to a maximum of $a_{b,emerg}$) once braking resumes. The braking interruption becomes a hazardous behaviour if at any point, $x < \frac{v^2}{2a_{b,emerg}}$, where $v$ is the ego vehicle speed and $x$ is the remaining distance to the stopped vehicle, since a collision will result. Different misperceptions could lead the ADS to interrupt braking, including: not detecting the stopped car, misjudging the position of the stopped car as not obstructing the ego vehicle and misjudging the speed of the car ahead as not stopped. In this study, we focus on the first of these---missed detections (i.e., FNs)---and assume that if the car is detected, other information about it will be correctly perceived. To define $\name{MP}_{\mbox{\scriptsize{\name{SCA}}}}$, we first define the frame misperception pattern $\mbox{\name{FNA}} : Y \to pow(Y)$ identifying an FN for the vehicle ahead. \begin{mydefinition}[Frame misperception pattern \mbox{\name{FNA}}] \begin{multline*} \forall y, y_{\scriptsize{\name{gt}}}\in Y\cdot y\in\mbox{\name{FNA}} (y_{\scriptsize{\name{gt}}}) \text{ iff } \\ (\exists bb_{\scriptsize{\name{gt}}}\in y_{\scriptsize{\name{gt}}} \cdot \name{AheadOf}(y_{\scriptsize{\name{gt}}}, bb_{\scriptsize{\name{gt}}},\name{Ego}))\wedge \\ (\neg \exists bb\in y \cdot \name{TPMatch}(bb_{\scriptsize{\name{gt}}},bb)) \end{multline*} Where, $\name{AheadOf}(y,bb,bb')$ iff bounding box $bb\in y$ is positioned ahead of $bb'$ with no other in between, \name{Ego} is the bounding box for the ego vehicle and $\name{TPMatch}(bb,bb')$ iff $bb'$ matches $bb$ well enough to be considered a true positive prediction for $bb$. \end{mydefinition} \begin{figure} \centering \includegraphics[width=0.40\textwidth]{images/misper_cropped.pdf} \vspace{-.1in} \caption{ Illustration of frame misperception pattern \mbox{\name{FNA}}~on two point cloud outputs of task \name{OD} with same input $x$ (predictions are dashed boxes, ground truth are solid boxes). In output $y_a$, \mbox{\name{FNA}}~occurs since the vehicle ahead of ego vehicle is FN (shown larger), thus $y_a\in\mbox{\name{FNA}} (\name{OD}(x))$. In output $y_b$, the vehicle ahead is TP, thus \mbox{\name{FNA}}~does not occur and $y_b\notin\mbox{\name{FNA}} (\name{OD}(x))$. Accuracy on other objects is irrelevant for \mbox{\name{FNA}}. Classes: Car (red), Pedestrian (orange), Cyclist (purple), Other (gray).} \vspace{-0.2in} \label{fig:misper} \end{figure} Fig.~\ref{fig:misper} illustrates \mbox{\name{FNA}}. To define $\name{MP}_{\mbox{\scriptsize{\name{SCA}}}}$ we must determine what sequences of \mbox{\name{FNA}}~occurrences yield enough a braking interruption to be hazardous. To do this, we conducted a physics-based analysis combined with ADS simulation and determined that the worst-case (minimum) hazardous braking interruption is a single interruption of $t_{crash}=0.48\,s$ beginning $19.65\,m$ from the stopped vehicle with $v_{init}=11.11m/s$ (i.e., speed limit) and an ego vehicle acceleration of $a_{max}=3.02\,m/s^2$ during the interruption. Given the frame rate of $10\,f/s$, this means that braking must be interrupted for $5$ frames. However, since the tracker component requires $n_{trk}=9$ consecutive FNs before the track is lost, \name{PoPi}~must exhibit at least $n_{crash}=5+9=14$ \mbox{\name{FNA}}~occurrences to cause a hazardous braking interruption. \begin{mydefinition}[$\name{MP}_{\mbox{\scriptsize{\name{SCA}}}}$]\label{def:MPsca} For all drives $d\in \mathcal{D}$, $\name{MP}_{\mbox{\scriptsize{\name{SCA}}}}(d)$ iff it contains at least $n_{crash}=14$, not necessarily consecutive, occurrences of \mbox{\name{FNA}} \end{mydefinition} Note that consecutiveness is not specified here because there are non-consecutive sequences of \mbox{\name{FNA}} s that can be hazardous, but based on the above analysis, more than $14$ \mbox{\name{FNA}} s are required. \subsection{Goal \clm{Res} and Solution \sol{Res}} Since we are only considering a single HMP in this case study, this goal is not applicable. \subsection{Goal \clm{MP$_{\mbox{\scriptsize{\name{SCA}}}}$-N} and Solution \sol{MP$_{\mbox{\scriptsize{\name{SCA}}}}$-N}} Evidence for this claim is based on the argument that since we are limiting the focus to braking interruptions due to \name{OD} misperceptions, this could only have been caused by occurrences of \mbox{\name{FNA}}~misleading the ADS into believing there is no car ahead. Furthermore, by the physics/simulation analysis discussed in Sec.~\ref{sec:hmpsca}, producing a hazardous braking interruption requires at least $14$ \mbox{\name{FNA}} s. Finally, by Def.~\ref{def:misperc}, $\name{MP}_{\mbox{\scriptsize{\name{SCA}}}}$ represents all possible sequences containing at least $14$ \mbox{\name{FNA}} s. Therefore, we conclude $P_{\mbox{\scriptsize{\name{PoPi}}}}(\name{MCrash}|\name{HBSS}_{\mbox{\scriptsize{\name{SCA}}}},\neg\name{MP}_{\mbox{\scriptsize{\name{SCA}}}})\cong 0$ (approximation to account for potential small error in analysis). \subsection{Goal \clm{MP$_{\mbox{\scriptsize{\name{SCA}}}}$-CR} and Solution \sol{MP$_{\mbox{\scriptsize{\name{SCA}}}}$-CR}} The physics/simulation analysis discussed in Sec.~\ref{sec:hmpsca} says that fewer than $14$ \mbox{\name{FNA}} s cannot produce the hazardous behaviour, but it is still possible that $14$ or more non-consecutive \mbox{\name{FNA}} s may not be hazardous. For example, 2 non-consecutive groups of 9 \mbox{\name{FNA}} s is non-hazardous due to the tracker compensation. Although a simulation study could yield a more accurate estimate of this crash rate, for this claim we take a conservative stance and set $\gamma_{\mbox{\scriptsize{\name{SCA}}},\scriptsize{\name{CR}}}=1$. \subsection{Goal \clm{HBSS$_{\mbox{\scriptsize{\name{SCA}}}}$} and Solution \sol{HBSS$_{\mbox{\scriptsize{\name{SCA}}}}$}} We assume that the bound in this claim is based on information from the corresponding system-level hazard in \mdl{ADS}. For this case study, we conservatively assume that $\name{HBSS}_{\mbox{\scriptsize{\name{SCA}}}}$ occurs at every intersection. If the ego vehicle is travelling at the speed limit ($11.11\,m/s$) and the average distance between intersections is $500\,m$, then we let $\gamma_{\mbox{\scriptsize{\name{SCA}}},\scriptsize{\name{HBSS}}}=1.11/500 = 0.0022$ since $1.11\,m$ is travelled per state and one state ends an $\name{HBSS}_{\mbox{\scriptsize{\name{SCA}}}}$ drive per $500\,m$. \subsection{Goal \clm{MP$_{\mbox{\scriptsize{\name{SCA}}}}$-MR} and Strategy \stg{MP$_{\mbox{\scriptsize{\name{SCA}}}}$-PO}} The claim is $P_{\mbox{\scriptsize{\name{PoPi}}}} (\name{MP}_{\mbox{\scriptsize{\name{SCA}}}}|\name{HBSS}_{\mbox{\scriptsize{\name{SCA}}}})\leq \gamma_{\mbox{\scriptsize{\name{SCA}}},\scriptsize{\name{MR}}}$. To decompose HMP \name{SCA}~we consider a single non-nominal PO condition: $\name{PO}_{\mbox{\scriptsize{\name{Crowd}}}}$ identifying crowded scenes defined as those containing more than 10 objects within 40\,m of the ego vehicle. This is based on the assumption that crowded scenes will contain more FNs than uncrowded. \subsection{Goals \clm{PO$_{\mbox{\scriptsize{\name{SCA}}},j}$} and Solutions \sol{PO$_{\mbox{\scriptsize{\name{SCA}}},j}$}} We estimate the probability of crowded scenes by the proportion of such scenes in the KITTI test dataset and use the $99\%$ confidence interval to account for sampling error. The bound estimates are given in Table~\ref{tab:po}. \begin{table} \centering \begin{tabular}{|c|c|c|c|c|} \hline $j$ & $\frac{|\name{TDS}_{j}|}{\name{|TDS|}}$ & $\sigma_{0.99}$ & $\gamma_{\mbox{\scriptsize{\name{SCA}}},j,\scriptsize{\name{PO}}\downarrow}$ &$\gamma_{\mbox{\scriptsize{\name{SCA}}},j,\scriptsize{\name{PO}}\uparrow}$ \\ \hline \mbox{\scriptsize{\name{Nom}}} & 0.965 & 0.008 & 0.957 & 0.973 \\ \hline \mbox{\scriptsize{\name{Crowd}}} & 0.035 & 0.008 & 0.027 & 0.043 \\ \hline \end{tabular} \vspace{0.1in} \caption{Computation of bounds $\gamma_{\mbox{\scriptsize{\name{SCA}}},j,\scriptsize{\name{PO}}\downarrow}$ and $\gamma_{\mbox{\scriptsize{\name{SCA}}},j,\scriptsize{\name{PO}}\uparrow}$}. \vspace{-.3in} \label{tab:po} \end{table} \subsection{Goals \clm{PO$_{\mbox{\scriptsize{\name{SCA}}},j}$-MR} and Strategies \stg{PO$_{\mbox{\scriptsize{\name{SCA}}},j}$-FMP}} We decompose using frame misperception pattern \mbox{\name{FNA}}. If we assume each \mbox{\name{FNA}}~occurrence is independent, then given Def.~\ref{def:MPsca}, we have the following expression as expected value of the cumulative binomial over drives of varying length $n$, $$P_{\mbox{\scriptsize{\name{PoPi}}}}(\name{MP}_{\mbox{\scriptsize{\name{SCA}}}}|\name{HBSS}_{\mbox{\scriptsize{\name{SCA}}}}, \name{PO}_{j})=\mathbb{E}_n\left[{\sum_{l=14}^{n}{{n\choose l} p_j^l (1-p_j)^{(n-l)}}}\right]$$ Where, $p_j = P_{\mbox{\scriptsize{\name{PoPi}}},fr}(\mbox{\name{FNA}}|\name{HBSS}_{\mbox{\scriptsize{\name{SCA}}}}, \name{PO}_{j})$. Note that the cumulative binomial is monotonic in $n$ and max $n=55$ occurs when starting with max $v_{init}=11.11m/s$. Thus, for the linking expression we use, \vspace{-.1in} $$P_{\mbox{\scriptsize{\name{PoPi}}}}(\name{MP}_{\mbox{\scriptsize{\name{SCA}}}}|\name{HBSS}_{\mbox{\scriptsize{\name{SCA}}}}, \name{PO}_{j})\leq\sum_{l=14}^{55}{{55\choose l} p_j^l (1-p_j)^{(55-l)}}$$ \subsection{Goals \clm{FMP$_{\mbox{\scriptsize{\name{SCA}}},j,\mbox{\scriptsize{\name{FNA}}}}$-MR}} The objective here is to estimate $P_{\mbox{\scriptsize{\name{PoPi}}}}(\mbox{\name{FNA}}|\name{HBSS}_{\mbox{\scriptsize{\name{SCA}}}}, \name{PO}_{j})$. To do this, we extracted frames from the KITTI dataset conforming to \name{HBSS}$_{\mbox{\scriptsize{\name{SCA}}}}$ and \name{PO}$_j$ to form datasets \name{TDS}$_{\mbox{\scriptsize{\name{SCA}}},j}$ and used these to test \name{PoPi}~and compute the risk-aware metrics $m_{\mbox{\scriptsize{\name{SCA}}},j,\mbox{\scriptsize{\name{FNA}}}}$. Specifically, \name{TDS}$_{\mbox{\scriptsize{\name{SCA}}},j}$ consisted of frames in which there was a car ahead of the ego vehicle. These frames over-approximate the set of frames from \name{HBSS}$_{\mbox{\scriptsize{\name{SCA}}}}$ drives because it doesn't consider the speed of the ego vehicle ($v_{init}$) or whether the car ahead is stopped or moving; however, the single-frame misperception performance is unaffected by this. Table~\ref{tab:fna} gives the results assuming a $99\%$ confidence bound. \begin{table} \centering \begin{tabular}{|c|c|c|c|c|c|} \hline $j$ & $|\name{TDS}_{\mbox{\scriptsize{\name{SCA}}},j}|$ & $m_{\mbox{\scriptsize{\name{SCA}}},j,\mbox{\scriptsize{\name{FNA}}}}$ & $\sigma_{0.99}$ & $\gamma_{\mbox{\scriptsize{\name{SCA}}},j,\mbox{\scriptsize{\name{FNA}}}}$ & $\gamma_{\mbox{\scriptsize{\name{SCA}}},j,\scriptsize{\name{MR}}}$ \\ \hline \mbox{\scriptsize{\name{Nom}}} & 1479 & 0.052 & 0.015 & 0.067 &$1.15\times 10^{-5}$ \\ \hline \mbox{\scriptsize{\name{Crowd}}} & 67 & 0.045 & 0.065 & 0.110 & $2.06\times 10^{-3}$\\ \hline \end{tabular} \vspace{0.1in} \caption{Computation of bounds $\gamma_{\mbox{\scriptsize{\name{SCA}}},j,\mbox{\scriptsize{\name{FNA}}}}$ and $\gamma_{\mbox{\scriptsize{\name{SCA}}},j,\scriptsize{\name{MR}}}$.} \vspace{-.4in} \label{tab:fna} \end{table} \subsection{Summary} Propagating the values of bounds for the leaf claims upward using the expressions in the strategies, we obtain values for higher claims. Based on the values in Table~\ref{tab:po} and Table~\ref{tab:fna} for PO conditions \name{Nom} and \name{Crowd}, we have: \vspace{-0.05in} $$\gamma_{\mbox{\scriptsize{\name{SCA}}},\scriptsize{\name{MR}}}= (0.973)1.15\times 10^{-5}+(0.043)(2.06\times 10^{-3})=9.98\times 10^{-5}$$ The dominant contribution is clearly from PO condition \name{Crowd}. Then we can define: \vspace{-0.05in} $$\gamma_{\mbox{\scriptsize{\name{SCA}}}}=\gamma_{\mbox{\scriptsize{\name{SCA}}},\scriptsize{\name{MR}}}\gamma_{\mbox{\scriptsize{\name{SCA}}},\scriptsize{\name{HBSS}}}=(9.98\times 10^{-5})(2.2\times10^{-3})=2.20\times10^{-7}$$ \noindent Thus, the top claim: $\gamma_{\mbox{\scriptsize{\name{PoPi}}}}=\gamma_{res}+\gamma_{\mbox{\scriptsize{\name{SCA}}}}=\gamma_{res}+2.20\times10^{-7}$ Since this is analysis based on one HMP is only partial, we leave $\gamma_{res}$ as a variable term. \section{Introduction} Safety assurance is a central concern for the development and societal acceptance of Automated Driving Systems (ADS). It is no coincidence that major players in this field have made their safety strategies publicly available (e.g.,~\cite{wood2019safety, webb2020waymo}). An ADS relies heavily on complex perception tasks to accurately determine the state of the world. These include image classification, object detection and image segmentation using camera, LiDAR and Radar sensor data. Because these tasks are difficult to specify, machine learning (ML) is a preferred method of implementation; however, ML poses significant obstacles to safety assurance~\cite{salay18}. Despite this, the safety critical nature of perception requires reliable approaches to assuring their safety. An ADS safety case aims to provide a hierarchical evidence-based argument for the claim that the ADS is acceptably safe. An important quality of a safety argument is ``rigor'', but when the steps of the argument are based on informal or non-deductive reasoning, this may be difficult to ensure. To address this, Rushby~\cite{rushby2015interpretation} has suggested that the internal decomposition steps of a safety case should be deductive, while inductive reasoning (e.g., generalizing from test results) are limited to the leaf claims that are supported directly by evidence. This is the approach we take in this paper to define a generic argument template for a perception component within an ADS. A limited amount of related work on safety cases in the ADS domain exists both at the whole system ADS level and at the unit-level for individual ML components. Kurd et al.~\cite{kurd2007developing} give a safety case for neural networks, and more recently, Burton et al.~\cite{burton2017making} give one for ML components in automated driving. Both use Goal Structuring Notation (GSN)~\cite{assurance2021goal}, but remain high-level. Wozniak et al.~\cite{wozniak2020safety} define a GSN argument pattern for ML components to produce an ISO 26262 style safety case. The pattern covers refinement of unit-level safety requirements, data appropriateness, adequacy of the component design and component training. The latter three areas are given a more detailed treatment with sub-claims proposed. Picardi et al.~\cite{picardi2020assurance} also focus on the unit level and sketch a safety case pattern in which each ML assurance claim is supported by a series of \emph{confidence arguments} that show why the claim is supported by context artifacts such as the test dataset, learned model, ML safety requirements, etc. These confidence arguments, in turn, draw on the ML development lifecycle~\cite{ashmore2019assuring} that specify high-level requirements regarding these artifacts. For example, it specifies that test data should be ``relevant, complete, accurate and balanced''. The authors note that the ML assurance claims are drawn from ML safety requirements, which in turn are refined from system-level safety requirements based on methods such as hazard analysis; however, they do not elaborate this connection. As an illustration of how this could work, Gauerhof et al.~\cite{gauerhof2020assuring} study the elicitation of safety requirements for an ML-based pedestrian detector. For example, an analysis of the system-level safety requirement ``Ego shall stop at the crossing if a pedestrian is crossing'' yields several object detection component safety requirements such as ``Position of pedestrians shall be determined within 50\,cm of actual position''. Then the ML development lifecycle is used to guide the identification of detailed requirements for the confidence arguments---e.g., ``The data samples shall include sufficient range of environmental factors within the scope of the ODD'' is a requirement to address test data completeness. The recent work by Bloomfield et al.~\cite{bloomfield2021safety} is an extensive effort to define a safety case template using the Claims-Argument-Evidence (CAE) notation, for autonomous systems that include ML components. It assumes that ML components will be coupled with monitors that guard the component against bad behaviour. The template focuses on the adequacy of hazard analysis at the system level and gives high-level templates for arguments at the monitor+ML subsystem-level as well as the unit-level for the ML component. The reasoning approach advocated is informal with an emphasis on identifying potential \emph{defeaters} that challenge claims. As with the work of Picardi et al.~\cite{picardi2020assurance}, there is a brief discussion about connecting the system-level requirements to the unit-level but details are missing. For example, ``The number of crashes involving the AV averages at most 89 crashes per million miles driven with confidence 95\%.'' is given as a sample system-level claim and ``YOLOv3 correctly identifies traffic lights in 87\% of images containing traffic lights'' is a claim at the unit-level but the parts of the argument that show how the performance of object detector YOLOv3 impacts the crash rate of the AV are not addressed by the template. \begin{figure} \centering \includegraphics[width=0.49\textwidth]{images/positioning_cropped.pdf} \caption{Role of the safety case argument template M-$C$ for perception component $C$ presented in this paper. Arrows represent ``is supported by'' where a higher-level argument is supported by a lower-level one.} \label{fig:positioning} \vspace{-.3in} \end{figure} In this paper, we address the gap between the system-level and unit-level arguments by proposing a template for a ``linkage argument'' connecting these. This is illustrated in Fig.~\ref{fig:positioning} using GSN safety case modules. The proposed safety case template module \mdl{$C$} for perception component $C$ sits between the main ADS argument module \mdl{ADS} that relies on a claim about component contribution to system safety and the unit-level argument module \mdl{$C$-unit} that provides evidence for specific component properties required by safety. Furthermore, in contrast to the informal argumentation in the work reviewed above, we take a formal and deductive approach to this argument. Our contributions are: \begin{itemize} \item A formal safety case template linking system and unit arguments using a safety claim decomposition method based on \emph{hazardous misperception patterns} that separates analysis of ADS dynamics from perception. \item The use of the safety case template to identify a set of \emph{risk-aware} performance metrics that are tailored to the component and the ADS in which it operates. \item A safety case stucture that has desirable properties including stability with respect to component changes and support for assessing risk trade-offs in different operational situations. \end{itemize} The remainder of the paper is structured as follows. In Sec.~\ref{sec:prelim} we give the formalization preliminaries. Sec.~\ref{sec:safetycase} presents the formal safety case template using GSN notation. This is followed by a discussion in Sec.~\ref{sec:discussion} on the application of the template in development. The use of the template is illustrated with a detailed example in Sec.~\ref{sec:casestudy}. Finally, in Sec.~\ref{sec:conclusion} we give conclusions and discuss future work. \section*{Acknowledgment} \input{intro} \input{prelim} \input{approach} \input{discussion} \input{example} \input{conclusions} \bibliographystyle{IEEEtran} \section{Preliminaries}\label{sec:prelim} In this section we define the terms and notation using in the template. \subsection{Perception Tasks} We distinguish between the perception task $T$ in the ADS and a component \mbox{$C$}~that implements the task. For example, $T$ may represent the task ``detect and localize vehicles surrounding the ego vehicle'' while \mbox{$C$}$_1$ and \mbox{$C$}$_2$ may be alternate components that implement this task with different performance characteristics. \begin{mydefinition}[Perception task]\label{def:ptask} A \emph{perception task} $T$ is represented as function $T:X\to Y$ from input domain $X$ to output codomain $Y$ defining the ``ground truth'' of how the task should be performed. If component $C$ implements $T$, then it defines function $C:X\to Y$. The unit of perception for $T$, called a \emph{frame}, is denoted $(x,y)\in X\times Y$. The \emph{frame rate} is the number of frames per unit time. The distribution $P_{C,fr}(x,y)$ denotes the probability of frame $(x,y)$ occurring while the ADS operates a vehicle in the ODD using component $C$ that implements $T$. \end{mydefinition} For example, task $\name{OD}$ for camera-based object detection defines function $\name{OD}:\name{CImage}\to\name{BBSet}$ from camera images to bounding box sets. Object detector $\name{Yolo}:\name{CImage}\to\name{BBSet}$ implements $\name{OD}$. A frame is a single camera image and corresponding output set of bounding boxes. \subsection{Drives} We define notation for describing driving scenarios. \begin{mydefinition}[States and drives] A state $s$ is a snapshot of all relevant ADS and environment state variables at a point in time. $\mathcal{S}$ is the set of possible states. A \emph{drive} is a finite sequence $d\in\mathcal{S}^*$ of states. $d[k]$ denotes the $k^{th}$ state of $d$ and $d'\subseteq d$ denotes that drive $d'$ is a subsequence of $d$. $\mathcal{D}\subseteq\mathcal{S}^*$ is the set of drives that can occur in the ODD. \end{mydefinition} The rate at which snapshots are taken determine how fine-grained in time the drive is represented. For the argument \mdl{\mbox{$C$}}, it is convenient to a take task-centric view and assume that this is the frame-rate for $T$. We can classify states that occur during ADS operation using temporal properties. \begin{mydefinition}[State classification] $\mbox{$P_C$}(s_t\in \phi)$ (or $\mbox{$P_C$}(\phi)$) denotes the probability that a randomly chosen state during ADS operation in the ODD using component \mbox{$C$}~satisfies temporal property $\phi$, i.e., $\mbox{$P_C$}(\phi)=P(s_t\in \phi|C)$. $\name{MCrash}$ denotes the temporal property identifying crash states caused by some preceding sequence of misperceptions in performing task $T$. \end{mydefinition} Thus, $\mbox{$P_C$}(\name{MCrash})$ denotes the probability that a misperception-caused crash state occurs when using component \mbox{$C$}. \subsection{Misperceptions} The safety of perception tasks is impacted by the presence of misperceptions. \begin{mydefinition}[Misperception] \label{def:misperc} Given task $T$, a \emph{misperception} is a frame $(x,y)$ such that $y\neq T(x)$. A misperception \emph{by component} $C$ is a frame $(x, C(x))$ that is a misperception. \end{mydefinition} The safety impact of a misperception varies depending on the context in which it occurs. For example, in a vehicle detection task, a false negative (FN) (i.e., not detecting a vehicle) or false positive (FP) (i.e., falsely detecting a vehicle) close to the ego vehicle may be hazardous, but when these occur far away, they may be benign. Although having too many benign misperceptions can negatively impact ADS performance, in the safety argument for component $C$ we consider only the hazardous misperceptions it can produce. In order to characterize misperceptions, we generalize from individual misperceptions to \emph{patterns} of misperceptions. \begin{mydefinition}[Misperception pattern] \label{def:mispat} A \emph{misperception pattern} $\name{MP}\subseteq \mathcal{D}$ identifies a subset of drives such that for all $d\in \name{MP}$, some states in $d$ contain misperceptions. A \emph{frame misperception pattern} is a function $\name{fMP}:Y\to pow(Y)$ such that $\forall y\in Y\cdot y\notin \name{fMP}(y)$, where $pow(Y)$ is the power set of $Y$. State $s$ containing frame $(x,y)$ \emph{satisfies} frame misperception pattern \name{fMP}, denoted $\name{fMP}(s)$ iff $y\in \name{fMP}(T(x))$. \end{mydefinition} Misperception patterns can be used to categorize misperceptions based on conditions of interest. For example, the frame misperception pattern \name{FN_{20}} can denote all object detection misperceptions that include false negatives within $20\,m$ of the ego vehicle. The misperception pattern \name{30FN_{20}} can denote the set of all drives satisfying \name{FN_{20}} in at least 30\% of its states. Thus, misperception patterns are naturally defined in terms of frame misperception patterns and we exploit this in the safety argument. \subsection{Hazardous misperceptions} Following ISO 26262~\cite{ISO26262} and SOTIF~\cite{ISO21448}, system-level hazard analysis identifies cases where a driving scenario combined with a hazardous behaviour by the ego vehicle and particular reactions by scenario participants will result in harm (i.e., an accident). For example, the ego vehicle waiting to turn left at an intersection is a scenario in which, if the ego vehicle begins turning with an on-coming vehicle too close (hazardous behaviour), and the on-coming car cannot stop (participant reaction), a collision will occur. We define a term to represent these cases. \begin{mydefinition}[Hazardous Behaviour Sensitive Scenario] A \emph{Hazardous Behaviour Sensitive Scenario} $\name{HBSS}\subseteq\mathcal{D}$ is a subset of drives exhibiting a particular combination of operational scenario with participant reactions in which there are possible hazardous ego vehicle behaviours. \end{mydefinition} In some cases, the hazardous behaviour in an HBSS can be \emph{caused by} a sequence of frame misperceptions in performing perception task $T$. For example, in the HBSS with the ego vehicle turning left, the hazardous behaviour could be caused by a sequence of misperceptions in the \name{OD} task over several frames that leads the ADS to believe there is no vehicle coming and allows a hazardous left turn to be performed. We refer to such sequences as \emph{hazardous misperceptions} and formalize their occurrences as a type of misperception pattern. \begin{mydefinition}[Hazardous Misperception Pattern]\label{def:hmp} A \emph{hazardous misperception pattern (HMP)} is a pair $\tuple{\name{HBSS},\name{MP}}$ of predicates over set $\mathcal{D}$ of drives where, \begin{itemize} \item \name{HBSS} is the \emph{Hazardous Behaviour Sensitive Scenario condition} that specifies properties of the drive required for the scenario to occur and no other drive factors. At most one state in the drive can be crash state and it must occur at the end of the drive. \item \name{MP} is the \emph{Misperception Pattern condition} that specifies \emph{all} sequences of misperceptions that will cause a hazardous behaviour in drives that satisfy the \name{HBSS} condition. The \name{MP} condition constrains only drive factors essential for describing the misperceptions. \end{itemize} A drive $d\in \mathcal{D}$ \emph{satisfies} the HMP iff $$\name{HBSS}(d)\wedge (\exists d'\in \mathcal{D}\cdot \name{MP}(d')\wedge d'\subseteq d)$$ \end{mydefinition} The condition \name{HBSS} says that the HBSS for the system hazard associated with HMP occurs over the length of the drive. Thus, a drive satisfying \name{HBSS} represents a complete scenario that ends in a crash if any hazardous behaviour by the ego vehicle as identified by the HBSS occurs. Condition \name{MP} identifies the sequences of misperceptions performing task $T$ that, when they occur within an \name{HBSS} drive, will cause a hazardous behaviour to occur leading to a crash. This condition would naturally be expressed in terms of various frame misperception patterns. For example, assume HMP \name{IL} is based on the $\name{HBSS}_{\name{IL}}$ condition that identifies a drive in which the ego vehicle is waiting to turn left at an intersection. We focus on the hazardous behaviour in which the ego vehicle begins turning with an on-coming vehicle too close, causing a collision. This hazardous behaviour could be caused by misjudging the position and/or speed of the on-coming vehicle (mis-localization) or not detecting the on-coming vehicle (FN). With analysis and experimentation, it is possible to determine the exact sequences of these misperceptions that would cause the hazardous behaviour and these are used to define $\name{MP}_{\name{IL}}$. Although drive predicates such as \name{HBSS} and \name{MP} play an important role in the safety argument, we do not specify a formal language for expressing drive predicates and instead remain at the semantic level, thinking of predicates in terms of the sets they define. For example, drive predicates can be defined using a general language such as First Order Logic (FOL), or more specialized logics such as temporal logic (e.g., Linear Temporal Logic). Remaining ``syntax agnostic'' gives the safety argument template the flexibility to be used in different analytical contexts. \section{Related Work}\label{sec:related}
{ "redpajama_set_name": "RedPajamaArXiv" }
29
Q: How to change value of inspecter scale using c# Is it possible to change the inspectors values like scale? Can i do it with a script? Each time I have to generate obstacles with different scale values im realy new to unity so more explanation is needed the code for obstacle is written here: using UnityEngine; public class Obstacle : MonoBehaviour { //rigi=GetComponent<Rigidbody2D>(); public Vector2 velocity = new Vector2(-4, 0); public float r; // Use this for initialization void Start() { GetComponent<Rigidbody2D>().velocity = velocity; transform.position = new Vector3(transform.position.x, transform.position.y - r * Random.value, transform.position.z); } } A: All you need to do to change an objects scale in script is use: theObject.transform.localScale.Set(x, y,z); You could change it in the start of your script, or make methods that increase or decrease the scale that you can call from other scripts. Is that what you meant to do?
{ "redpajama_set_name": "RedPajamaStackExchange" }
4,265
El Palau Pina Manique és un palau sense acabar a Manique do Intendente, Azambuja. La construcció del palau es deu a l'intendent Pina Manique, però restà inacabat per problemes monetaris, i més tard a causa de la mort de Pina Manique. A hores d'ara és una església que substitueix la capella. També és la Casa del Poble. Es considera per la Direcció General del Patrimoni Cultural un immoble d'interés públic. Referències Patrimoni arquitectònic de Portugal Palaus de Portugal
{ "redpajama_set_name": "RedPajamaWikipedia" }
3,942
Q: Making a writeable directory in laravel using mkdir() My issue isn't that the folder is getting written, it's the permissions that it's being written with. Here is the code I'm using the write the file: // check if the file/folder exists $targetPath = 'files/docmoga/'; if(!file_exists($targetPath)){ $oldmask = umask(0); mkdir($targetPath, '0777', true); umask($oldmask); } move_uploaded_file($tempFile, $targetFile); It's failing on the last line because of permissions. Here are the permissions the folder is being written with: dr----x--t 2 apache apache 4096 May 4 09:17 docmoga What might be happening to cause the permissions to being written incorrectly for that folder? If it helps I'm using laravel as a framework which I know shouldn't mean anything. A: Have you checked what user your script is running under? Run exec('whoami') in your script and look at the output. It should be apache or a user that has the appropriate permissions to create the folder. Also try to use the literal octal number 0777 vs a string version '0777'. Taken from https://stackoverflow.com/a/2251293/1133306
{ "redpajama_set_name": "RedPajamaStackExchange" }
7,145
{"url":"https:\/\/brilliant.org\/discussions\/thread\/combinatorics-f\/","text":"# Combinatorics!\n\nHi, how do you hunt for the number of solutions of :\n\n$$0 \\leq a_{1} \\leq a_{2} \\leq a_{3} \\dots \\leq a_{m} \\leq a$$.\n\nHere is the solution:\n\nLet $S =$ {$a_{1}, a_{2}, \\dots a_{m}$},\n\nClearly, if we find this set, afterwards, there is only $1$ way of distribution, since the order is fixed.\n\nSay, amongst the set $S$, the integer $r$ comes $P_{r}$ times, then:\n\n$\\displaystyle \\sum_{r=0}^{a} P_{r} = m$, and $P_{r} \\geq 0$\n\nWe know that the number of the solutions of this typical equation is ${m+a \\choose a}$, hence , the set is chosen, and hence the required number of solutions of the original equation is also ${m+a \\choose a }$.\n\n_Below is an interesting problem: _\n\nWe want to create a Divisible Sequence of length $H$ from a number $N$. In a Divisible Sequence, every term (except the starting number) is a divisor of the previous term. Examples of Divisible Sequences of length $3$ starting with $10$ are:\n\n$10,10,10$\n\n$10, 10, 5$\n\n$10, 2, 2$\n\n$10, 10, 1$\n\n$10, 1, 1$\n\nFor primes $p_{1},p_{2}, \\dots p_{t}$, obtain an expression for the number of divisible sequences starting with $p_{1}^{q_{1}} p_{2}^{q_{2}} \\dots p_{t}^{q_{t}}$, of length $k+1$.\n\n$0 \\leq q_{i} \\forall i$\n\nNote: You might leave this expression in a sum or a product form.\n\n7\u00a0years, 6\u00a0months ago\n\nThis discussion board is a place to discuss our Daily Challenges and the math and science related to those challenges. Explanations are more than just a solution \u2014 they should explain the steps and thinking strategies that you used to obtain the solution. Comments should further the discussion of math and science.\n\nWhen posting on Brilliant:\n\n\u2022 Use the emojis to react to an explanation, whether you're congratulating a job well done , or just really confused .\n\u2022 Ask specific questions about the challenge or the steps in somebody's explanation. Well-posed questions can add a lot to the discussion, but posting \"I don't understand!\" doesn't help anyone.\n\u2022 Try to contribute something new to the discussion, whether it is an extension, generalization or other idea related to the challenge.\n\nMarkdownAppears as\n*italics* or _italics_ italics\n**bold** or __bold__ bold\n- bulleted- list\n\u2022 bulleted\n\u2022 list\n1. numbered2. list\n1. numbered\n2. list\nNote: you must add a full line of space before and after lists for them to show up correctly\nparagraph 1paragraph 2\n\nparagraph 1\n\nparagraph 2\n\n[example link](https:\/\/brilliant.org)example link\n> This is a quote\nThis is a quote\n # I indented these lines\n# 4 spaces, and now they show\n# up as a code block.\n\nprint \"hello world\"\n# I indented these lines\n# 4 spaces, and now they show\n# up as a code block.\n\nprint \"hello world\"\nMathAppears as\nRemember to wrap math in $$ ... $$ or $ ... $ to ensure proper formatting.\n2 \\times 3 $2 \\times 3$\n2^{34} $2^{34}$\na_{i-1} $a_{i-1}$\n\\frac{2}{3} $\\frac{2}{3}$\n\\sqrt{2} $\\sqrt{2}$\n\\sum_{i=1}^3 $\\sum_{i=1}^3$\n\\sin \\theta $\\sin \\theta$\n\\boxed{123} $\\boxed{123}$\n\nSort by:\n\ncan u explain it more easily ?\n\n- 7\u00a0years, 6\u00a0months ago","date":"2021-07-31 12:34:31","metadata":"{\"extraction_info\": {\"found_math\": true, \"script_math_tex\": 0, \"script_math_asciimath\": 0, \"math_annotations\": 31, \"math_alttext\": 0, \"mathml\": 0, \"mathjax_tag\": 0, \"mathjax_inline_tex\": 1, \"mathjax_display_tex\": 1, \"mathjax_asciimath\": 1, \"img_math\": 0, \"codecogs_latex\": 0, \"wp_latex\": 0, \"mimetex.cgi\": 0, \"\/images\/math\/codecogs\": 0, \"mathtex.cgi\": 0, \"katex\": 0, \"math-container\": 0, \"wp-katex-eq\": 0, \"align\": 0, \"equation\": 0, \"x-ck12\": 0, \"texerror\": 0, \"math_score\": 0.9828155636787415, \"perplexity\": 1943.8696448371545}, \"config\": {\"markdown_headings\": true, \"markdown_code\": true, \"boilerplate_config\": {\"ratio_threshold\": 0.18, \"absolute_threshold\": 10, \"end_threshold\": 15, \"enable\": true}, \"remove_buttons\": true, \"remove_image_figures\": true, \"remove_link_clusters\": true, \"table_config\": {\"min_rows\": 2, \"min_cols\": 3, \"format\": \"plain\"}, \"remove_chinese\": true, \"remove_edit_buttons\": true, \"extract_latex\": true}, \"warc_path\": \"s3:\/\/commoncrawl\/crawl-data\/CC-MAIN-2021-31\/segments\/1627046154089.6\/warc\/CC-MAIN-20210731105716-20210731135716-00184.warc.gz\"}"}
null
null
{"url":"https:\/\/math.stackexchange.com\/questions\/3163840\/why-are-there-only-13-archimedean-solids-and-not-14","text":"# Why are there only 13 Archimedean solids and not 14?\n\nI just finished a project on solids for geometry and I couldn\u2019t help but wonder out of curiosity why are there only 13 Archimedean solids and not 14 or more?\n\n\u2022 Do you know why there are only 5 Platonic solids? Mar 26 '19 at 22:47\n\u2022 Ummm... why did you write \"not 14\" rather than \"not 12\"? ....or not \"73\"? Mar 26 '19 at 22:48\n\u2022 It's analogous to, but a bit grungier than, the enumeration of Platonic solids: Any such polyhedron is a triangulation of $S^2$ and thus has $V - E + F = 2$, and the sum of face angles at a given vertex is at most $2\\pi$. Now regularity enforces a couple of inequalities that only have a few solutions in positive integers. Mar 26 '19 at 22:53\n\u2022 David G. Stork because I want to know why there aren\u2019t 14 or more? I know it\u2019s nothing less than 13 because if you take the 5 Platonic solids truncate them you get 7 Archimedean solids then take those and you get 4 more then you take the Platonic solid and you can snub it so you get the last two all together you get 13 so you can\u2019t have less. That\u2019s why I want to know why it\u2019s not 14 OR more (that includes your \u201c73\u201d because it\u2019s more than 14....) Mar 26 '19 at 22:54\n\u2022 Checking the Wikipedia page - not only are there two infinite families that would fit the definition if they weren't specifically excluded, there's also a fourteenth that fits a slight variation on the definition (local symmetry instead of global symmetry). It's all a matter of exactly what rules we apply. Mar 26 '19 at 22:55\n\nThis question has been answered in this publication : Walsh, T. R. S. Characterizing the Vertex Neighbourhoods of Semi-Regular Polyhedra.'' Geometriae Dedicata 1, 117-123, 1972. link","date":"2021-11-28 15:30:45","metadata":"{\"extraction_info\": {\"found_math\": true, \"script_math_tex\": 0, \"script_math_asciimath\": 0, \"math_annotations\": 0, \"math_alttext\": 0, \"mathml\": 0, \"mathjax_tag\": 0, \"mathjax_inline_tex\": 1, \"mathjax_display_tex\": 0, \"mathjax_asciimath\": 1, \"img_math\": 0, \"codecogs_latex\": 0, \"wp_latex\": 0, \"mimetex.cgi\": 0, \"\/images\/math\/codecogs\": 0, \"mathtex.cgi\": 0, \"katex\": 0, \"math-container\": 0, \"wp-katex-eq\": 0, \"align\": 0, \"equation\": 0, \"x-ck12\": 0, \"texerror\": 0, \"math_score\": 0.47577449679374695, \"perplexity\": 522.15488224975}, \"config\": {\"markdown_headings\": true, \"markdown_code\": true, \"boilerplate_config\": {\"ratio_threshold\": 0.18, \"absolute_threshold\": 10, \"end_threshold\": 15, \"enable\": true}, \"remove_buttons\": true, \"remove_image_figures\": true, \"remove_link_clusters\": true, \"table_config\": {\"min_rows\": 2, \"min_cols\": 3, \"format\": \"plain\"}, \"remove_chinese\": true, \"remove_edit_buttons\": true, \"extract_latex\": true}, \"warc_path\": \"s3:\/\/commoncrawl\/crawl-data\/CC-MAIN-2021-49\/segments\/1637964358560.75\/warc\/CC-MAIN-20211128134516-20211128164516-00212.warc.gz\"}"}
null
null
Remember, Redacted Tonight is a comedy show written and performed by Americans, in America covering American news yet it is called a foreign agent. Why is the BBC not on the list, they are the state broadcasters for the UK. Posted in Analysis & Review, Anti War & Peace, Finance & Economics, Government, Intelligence Agencies, Investigations & Inquiries, Politics, Protests & Civil Disobedience, Public Figures, Satire & Comedy, Speeches & Appeals, Television Video & Film, War. Tagged with Activists, Americans, BBC, Big Oil, Missing Money, Redacted Tonight, US Government.
{ "redpajama_set_name": "RedPajamaC4" }
3,520
*URGENT: As you may have heard, Bloodworks Northwest recently issued a "code-red" appeal for blood donors after inventories for some blood types fell alarmingly – to just a 1-day supply. The Rotary Club of Des Moines/Normandy Park, WA is conducting its annual Blood Drive on Friday July 22 and they need 25 donors. INFO: Our hope is to get 25 people to give selflessly of their time and blood. Free cookies, juice and chips! After any Holiday we see an inventory dip for several reasons. People are busy and don't donate as regularly planned as well as an increase in accidents needing blood products. You are able to help out by giving your blood and increase the low supply. We need to ask for additional help with this blood drive in order to start rebuilding the blood supply for the local hospitals. 16 years and older can give. Bloodworks Northwest issued a "code-red" appeal for donors last week after inventories for some blood types fell alarmingly — to just a one-day supply. Normal operating inventory is a four day supply. Some of our shelves are empty (media invited to Renton to tape). Blood donations this summer are down by about 25%. Summer is always a challenging time for blood collection. We expect donations to fall by about 15% during summer — with schools and colleges on break, and donors on vacation. This year the drop off has been much higher. The situation in the Northwest is part of a nationwide blood shortage. In normal circumstances we can ask for (and receive) help from centers in other regions who might have extra inventory. That's not possible this year – everyone is struggling to maintain inventory. Responding to emergencies requires blood that is already collected, tested, on the shelves and ready for immediate use. With the supply of red cells is at alarming levels, it would be impossible to respond to an unforeseeable emergency. The result could be cancelled or delayed surgeries. Only a four-day inventory allows us to respond immediately to emergencies, or to a dramatic increase in needs from local patients. Daily collections this summer are averaging less than 700. But it takes about 900 donors a day to maintain a sufficient blood supply for the 90 hospitals served by Bloodworks. The need for blood is continuous through the summer to support the normal needs of the regional healthcare system. Patients continue to undergo surgeries and organ transplants. ERs treat traumatic injuries and people receive blood components for cancer treatment.
{ "redpajama_set_name": "RedPajamaC4" }
6,811
Become the title sponsor of Patently-O Jobs and get in front of 15,000+ patent professionals. Deferred Examination: PTO to Hold Roundtable Discussion January 28, 2009 USPTO News It is clear that acting USPTO director John Doll has ideas for improving the patent system and that he is prepared to move the ball forward while he has the floor. Next on the order of business -- deferred examination. On February 12, 2009, the USPTO will hold a preliminary discussion on the potential for expanding the deferred examination system. Requests to participate should be sent to Robert Bahr (robert.bahr@uspto.gov). You may send comments to AC6comments@uspto.gov. Although attendance is open to the public, you must be pre-approved to 'participate.' The PTO currently has an "optional deferred examination procedure" that allows deferral of examination for up to three years from the priority date after a petition and payment of a fee. According to the PTO, this procedure has been used "fewer than two hundred" times since it was created in 2000. 37 C.F.R. 1.103(d). In other countries, deferred examination is much more popular. In those countries, the applicant can delay payment of some examination fees during the deferral period. However, seems unlikely that the delay in paying fees (saving a couple hundred dollars) would explain the difference in popularity of the systems. An alternative explanation may be inertia. In Japan, for instance, the applicant must take some action to end the deferral period; while in the US, the applicant must take some action to start the deferral period. These different energy barriers might explain some of the difference in the use of deferral. The best explanation might stem from the backlog of US patent applications which prevents most cases from being examined in the first three years. Under the current system, a deferral in the US does nothing to slow the examination process if the examination backlog is already more than three years. Deferred prosecution does have some possible negative issues. These negatives include the potential for submarining and shifting claim scope to encompass market changes. These problems could largely be limited through early publication of deferred applications as well as continued enforcement of the written description and enablement requirements. In addition, the patent term should continue to run during the deferral period. There are two main benefits of deferred examination: (1) delaying spending fees could have a great cost savings if the delay allows companies to figure out that a significant number of applications are no longer worth pursuing; (2) non-deferred cases should move more quickly through the system. In a 2008 letter to Congress, then PTO director Jon Dudas suggested three possible additions to the US system: (1) a 14-month extendible period for responding to a notice of missing parts; (2) a tiered payment structure that allows the "examination fee" to be paid later; and (3) allow applicants to claim priority to a provisional application for up to five years. Deferred Examination Announcement ← Bilski Petitions the Supreme Court to Decide Issues of Patentable Subject Matter Aventis Files for Certiorari: Challenging Federal Circuit's Low Standard for Intent to Deceive in Inequitable Conduct Proceedings → 45 thoughts on "Deferred Examination: PTO to Hold Roundtable Discussion" toaster says: The following appeared in the Comments to the proposed rules and is relevant to such extensions: What is it about this comment which you think readers of Patently-O would find offensive? Thanks for your report! BeeBee says: You cannot trust the Me-too lameduck temporary upper management of the PTO…our best bet is to get someome who knows patent law and cares for our patent system…besides do you really want to put your money on Doll…he wasted 36 hours to get his name on that announcement…sad MaxDrei says: I like the sound of the word "trenchant". And it's the ideal word to describe that last contribution. Is there any credible rebuttal? Anybody? What is blocking the way to its implementation? I don't want to be a spoilsport but there is just one small point though. The EPO used to have deferred examination, for historical/political/getting-up-and-running issues. But the inefficiencies of it were recognised, right from the outset. Now, with the EESR, EPO search reports carry, as an annexe, the first office action. When the EPO case publishes, 18 months after priority, the public gets the search report and the first O/A, but Applicant has still not paid the fee for examination. That's surely too arsy-versy for the USPTO. The better business for the PTO is to pull in the exam fee on day #1, then defer examination for XXX months, no? Moocow says: Deferred examination deserves further exploration for sure. For one, deferred exam is the norm rather than the exception internationally, the USPTO being the only office among the BigFive where applications enter the queue for substantive examination by default. Examination requests are due after 3 years in Japan & China, 5 years in Korea, and about 2 years in the EPO. In Canada they have a 5-year deferral period, in Germany 7 – the list runs on and on, and includes virtually all of the US major trading partners. The USPTO, even under today's backlog, routinely examines cases that are still under deferral in their foreign offices of first filing. This means more examination burden for the USPTO, and a nice benefit for examiners in deferred-examination countries. In addition, the dropout rates of cases where examination is never requested are nothing to sneeze at in these countries, ranging from more than 30% (Japan) to about 7% (EPO). The front-loaded U.S. examination system, on the other hand, has essentially no incentive for disinterested applicants to drop out. Requiring a request for examination after a deferral period could be one way to ferret out applicants who don't really care to get a patent anymore, and save a lot of wasted examiner time. I say let's talk about it. The concerns about trolling and patent creep and uncertainty could be addressed through safeguards like mandatory publication, third-party examination requests, and other provisions that exist in foreign patent offices. And finally on uncertainty – deferred examination has existed for decades in countries like Japan, Canada, or Germany. Are these systems really fraught with so much more uncertainty compared to the U.S.? Dennis, your new and improved comment posting boxes are really good. Many thanks. Medicine, I agree. The scope of protection stays open for the entire 20 year term, whether in Europe with cascading divisionals, or in the USA with cascading continuations. So, the only legal certainty the Statute can give to the public is to hold Applicants strictly to the content of their apps as filed. Then, an attorney can opine on the basis of the WO, or the EP-A or the USPTO file wrapper following opening up to public inspection at 18 months, with a fair degree of confidence about what claims might ultimately be carried through to issue. Of course, that's why the EPO is strict on admissibility of amendments, and why it thinks that drafting of original applications is the highest expression of the skills of a patent attorney. So, Europe gives impecunious Applicants what they want and need. Athough expedited examination is available at the EPO for no fee and no reason need be given, hardly anybody wants or asks for accelerated examination. Maybe they like having indefinite time to tune their claims to the market and defer the cost of grant stage translations. Further, the European system of giving compensation for infringement, starting from the date of WO publication, might be a tasty feature for impecunious inventors too. Are there any other features of European patent law that might interest you? You know, it was thought out quite carefully, when the founding fathers wrote it, from scratch, in 1973. Patent_Medicine says: If we have deferred examination, it will only work if the apps are required to be published. Right now, once an app is published the priority doc is available on Public PAIR (just like the PCT apps). So I really don't see the problem. Deferred exam, for a small fee (perhaps the old "Processing and Retention Fee"?) could be a great way to balance some applicants' needs for more time to commercialize, with the public's need for disclosure. The problem with the current form of deferred exam is that, if you filed a provisional, it only gets you 2 years of deferral. Normal prosecution ends up being a longer deferral than that. Mr Bloom says it so well that I can barely add anything useful. Paris works because it concerns itself with something very simple, namely, a one year period to get your foreigns on file, with effect from your first filing date. The patent law of the USA has nothing in common with that used in the rest of the world. The gulf is so great that my standard advice to clients is: whatever the solution is here, it's likely the opposite in the USA (and vice versa, by the way). Whether you let filers complete their provisionals 6 months, 6 semesters or 6 years after the provisional filing? So what? It's a trivial detail. If you want a patent system that Promotes the Progress and enhances investment efficiency, publish after 18 months, with first class subject matter indexing so investors and competitors can usefully monitor A publications. But your garage inventor voters won't like that, will they? "Does this run afoul of the 'as long as we treat foreign filers the same' provision? After all, they must file US applications within 12 months of their first filings, while US applicants can file US applications within 5 years of their first filings." Let's make sure you're starting from the right point. U.S. law must treat foreign NATIONALS the same, not foreign filers. (You might have meant the same thing, but foreign filer suggests someone who filed a priority application elsewhere.) U.S. law currently permits foreign nationals to file provisional patent applications in the U.S.; the proposed deferral options would presumably apply to these provisionals for foreign nationals just as for domestic applicants. Again, Paris requires that we grant a 12-month priority claim to foreign applicants, but doesn't say that we can't have a longer priority period for priority claims to provisionals. In fact, by virtue of our continuation rules, we already have a quite different priority scheme than most countries. And that's fine with respect to the Paris Convention, since we don't administer that scheme based on nationality of the applicant. Leo, Old European, My thoughts were related to the 12 month period to file national applications from the date of the first filing. I had thought that the 12 month expiration of the provisional was due to the 12 month to file corresponding foreign applications also applying to filing in the US base on a US provisional. I can see a difference there. I assume, then, that under the 5 year scheme you must file corresponding foreign applications within 12 months of the filing of the US provisional, but you can file a corresponding US non-provisional at any time specified by the USPTO (e.g. 5 years). 6 is a dolt says: "I doubt he's 'leaving'. If I had to guess, he'll go back to what he was before and Peggy iirc? will go back to what she was and so on down the line." Mr. Doll was the Commissioner for Patents before his current gig as Acting Director of the PTO. The commissioner position is a five year appointment from the Secretary of Commerce. When the five years are up, you have to be re-appointed, or you're out. The appointment of the previous Commissioner for Patents (Mr. Godici) was not renewed. And he didn't even have a 1.2 million application backlog or a 32 month pendency. Mr. Doll is not going to be appointed by President Obama to be the Director, and will go back to being Commissioner for Patents once a replacement is confirmed. My prediction is that when his five year appointment as Commissioner expires, he will not be renewed. Then he will be gone. I'm chilling the champagne in anticipation of that day. "He won't have many job offers once he leaves" He will be exceedingly lucky if he gets one offer. I guess there are always those prosecution mills that love to hire and trout out their former PTO officials for their "overseas" clients that may give him a look. Not sure why deferred examination would be an accomplishment. But hey, let's throw him a bone and assume it would be. Then yes, he would leave office with ONE accomplishment. JohnG says: "Gimme a break, I actually voted for Bush twice." Did you learn anything from that mistake? Posted by: Malcolm Mooney Yes, I did. I'll regret that second vote the rest of my life. I would like to see a massive management purge at the PTO, especially of those who blindly followed orders (or were too dimwitted to understand). broje says: Giving applicants an incentive to delay examination is a double edged sword. For the clients that want to avoid infringment, delayed examination is a nightmare due to the uncertainty it creates. The backlog is already causing this problem though. But the examination history of patents that are close, but not quite, to what you want to do, is a really useful road map for finding relevant prior art. The delay in examination and issuance of patents will make it even more difficult to find relevant prior art. For the clients that have an agressive patent filing strategy, delaying examination is a dream come true. They often value the threat of an unexamined patent application more highly than an issued patent with narrow claims. Many file provisional and then PCT, just to cause that delay. So there are already many options to delay examination for applicants. "Besides, maybe Doll would like to have ONE accomplishment on his resume before he leaves. He won't have many job offers once he leaves, except for perhaps the free software foundation." I doubt he's "leaving". If I had to guess, he'll go back to what he was before and Peggy iirc? will go back to what she was and so on down the line. Gideon Pope says: Examination is deferred all over the world because the only patents that matter, for most applicants, are U.S. and EPO, which is about 1/2 of the world's economy. Japan doesn't matter because Japan doesn't issue patents to foreign concerns – if anything, they issue splinters that vaguely resemble the patents that issue in the U.S. and the EPO and that offer you no protection in the JP legal system. hp684 says: it should be interesting to see how the uspto can take a rational idea, used in most other countries with excellent result… and totally screw it up/make it useless/pointless. Gimme a break, I actually voted for Bush twice. Hardly a partisan. But yes, I do hold grudges, sometimes for life. As I remember, this guy was willing to push the failed continuation ending rules through knowing they would address only about 1% of the backlog. At one time in the past, I had decided to make the PTO a career. provisional applications would need to be published in such case Gimme a break says: "He is a leftover from the bad Bush days" I am flabbergasted by this comment. Doll is a career patent guy. What a bitter little partisan you must be JohnG. You should attend an bitter little liberal anger management class. I hear Nancy lets-keep-the-poor-from-reproducing Pelosi needs a lab partner. "I do not believe it is wise to deal with this man. He is a leftover from the bad Bush days. Let that be known, wait and plan for talks with the new appointees." But rumor has it that Doll will still be with us for another year before he is replaced. That's still a long time to wait. David Stein says: "I don't want deferred examination. I want my client and my client's actual and potential competitors to know as soon as possible the scope of patent protection available, and my client wants to know the scope of competitors' patent protection as soon as possible." Most of my clients are similarly positioned. Also, I have some experience with spin-offs, and I've found that investors often don't put much stock in a filed patent application – they actually ask for and review (or have their counsel review) the first OA to see how likely and broadly the patent might issue. But there are cases where deferring examination is in the client's best interest. I'll give you two: 1) A sole inventor or small-entity client may be operating on a shoestring budget, and may wish to get the business up and running before taking on prosecution expenses (or, if the venture founders, may wish to walk away from it without paying unnecessary expenses.) 2) A large nonprofit organization, such as the tech transfer office of a state university, may be under pressure to out-license as many inventions as possible – not to maximize ROI, but simply to have its employees' inventions put into practice. The name of the game here is maximizing filings and licensing (at low rates) on a fixed patent expense budget. It may be in the office's best interest to devote most of its budget to filing fees in order to maximize filings, and to cut bait on the apps that haven't been licensed by the first OA. Therefore, pushing off the first OA as long as possible is preferable. – David Stein john prosecutor says: David Stein | Jan 28, 2009 at 03:11 PM — I agree Also, issued patents are better indexed and accessible than published applications. [sarcasm]Naow that we are paying them dues every year, they have a financial motive to keep us employed and in the profession. Best $100 bucks I ever spent.[/sarcasm] "John Doll is actually doing something he should have done when he first took office. Maybe he will actually listen to the patent bar this time!" I'm only slightly optimistic. Seems that every time the USPTO indicates that it wants a "dialogue" with practitioners, it anticipates that our half of the dialogue will consist of "I agree," "I understand," and "I will comply." Last October's "Partnering in Patents" program touted the promising subtitle: "An Open Dialogue Between the USPTO and the Bar." But there wasn't much "dialogue" to be had… only presentations on the USPTO's perspective and demands for compliance. The USPTO served up prepared answers to a selected set of soft-pitch questions, and it wasn't really in the mood to listen – just to make decrees. patent prosecutor says: many provisional applications are prepared and filed quickly and cheaply and do not meet 112 requirements. they are filed the day of or the day before a disclosure. a complete application is then filed within the one year period so there is no 102 bar. now if the regular application is filed later than one year, there will be all sorts of problems. Mad says: "And yet putting a limit on the number of continuation applications one can file is considered to be the worst thing ever in the history of the world." I have a far larger problem with limiting the number of RCE's. wow, John Doll is actually doing something he should have done when he first took office. Maybe he will actually listen to the patent bar this time! David Stein "If a pending application is an unresolved legal question, then the current system features many more questions than answers." News flash: many people who use the PTO system as a revenue-generating tool consider this a feature, not a bug. "we're already in an age where first OA pendency can easily outlast the entire life cycle of the product or business model to which it pertains (particularly in IT.)" "The best explanation might stem from the backlog of US patent applications which prevents most cases from being examined in the first three years." Exactly. What's the point of affirmatively a delay if the process will give it to you anyway? But looking past that – I'm ambivalent about this. On the one hand, I like allowing inventors to choose among several options in the examination process. Applicants can have many uses and business models in mind, and the USPTO's agreement to accommodate various interests has a nice "customer service" aspect. On the other hand, we're already in an age where first OA pendency can easily outlast the entire life cycle of the product or business model to which it pertains (particularly in IT.) The growing delays in the patent system are causing it to revert to a patent registration system: the item most often used in patent-related disputes (such as licensing negotiations) is not a patent, but an unexamined patent application. If a pending application is an unresolved legal question, then the current system features many more questions than answers. Given this state of affairs, I'm not sure that sanctioning delays is a good idea. Only once we fix the backlog problem through hiring, improved retention, and more efficient examination, so that most applications are examined within a year of filing – only then will this option be acceptable. SF says: "Perhaps to extend beyond one year, the PPA ought to have all the parts of a full U.S. application." You could allow status conversion to a utility (like they have now) for 2 to 5 years, but the provisional would at least have to have the standard utility elements. That would mitigate the cost-cutting provisional issue. I don't like the idea of letting applicants claim priority from provisional patent applications for up to five years. These provisional applications are not published. If that becomes the route, then the result will be delay in the availability of prior art references not only for use in examining applications, but also for applicants to determine whether it is worthwhile to go forward with conversion to regular. Also, I find that the applicants who want to file provisionals want to cut costs a lot, which means cutting corners, resulting in inferior patent disclosures. I wouldn't mind seeing provisionals go away altogether. These are actually really interesting ideas. I'm not too sure about extending the PPA period, because inventors are already a bit too prone to think that insufficient disclosure is in fact sufficient. Perhaps to extend beyond one year, the PPA ought to have all the parts of a full U.S. application. Hmm . . . Old European says: Dave, I can't see why it should contravene Paris. Give us a hint. Where are you coming from, on this issue? No. First, it's not clear that Paris Article 4 prohibits a longer period for claiming priority than 12 months. In any event, however, Article 4 A(1) adresses priority claims in one country to applications filed in another. It says nothing about a priority claim in a U.S. application to a U.S. provisional application. As long as the rules are non-discriminatory between U.S. nationals and non-U.S. nationals, I don't think there's any problem with Paris at all for the 5-year priority claim proposal. MGMT says: Let's just end universal examination altogether. Preserve examination resources for when a patent is asserted/threatened/licensed/etc. The USPTO probably best exists as a mere registration entity anyway. It all sounds reasonable. In Japan, do nothing and defer for 10 years – why?? to defer payment of fees. In US pay an ADDITIONAL fee up front to defer the application for less time than the PTO defers it for free. Yep – sign me up for the deferral program. His suggestions sound pretty good, except the last. Not that it isn't a good idea, but is there a problem with the Paris Convention? This is a from-the-hip question, but that thought popped into my head when I read it. Am I right? What if the request to examine fee were $10K in the first year, $8K in the second year, $6K in the third year, $4K in the fourth year and $2K for any year after that? As time passes, Applicants would be far enough past the initial drafting costs to objectively assess the marketability of their invention and decide to move forward or to not throw good money after bad. Will wonders never cease? (3) delaying spending fees could have a great cost savings if the delay allows companies to take 30 seconds on google to figure out that a significant number of applications are no longer worth pursuing. Just an ordinary white rabbit(TM) says: Yes sir boss, you read that right. What's wrong with me today? These suggestions seem to benefit inventors. Do I read that right? Post Your Patent Job Submit your job opening with Patently-O to get it in front of our network of over 30,000 patent professionals. Many top firms, corporations, and government agencies rely on us to help them find the best patent agents, attorneys, and more. Or, renew a listing posted in the last 45 days. Have questions? Read more about our submission process. Patent Associate - Law Firm - Providence, RI Patent Agent with Engineering/Aerospace Background - Law Firm - Washington, D.C., New York, Los Angeles, San Francisco Chemical Patent Attorney or Agent - Law Firm - Greenville, SC Patent Attorney (Chicago & Remote) - Law Firm - Chicago, IL Patent Litigation Associate - Law Firm - Houston, TX Patent Attorney/Patent Agent - Law Firm - New Providence, New Jersey or remote for the right candidate Patent Attorney/Agent - Law Firm - Washington, D.C. (Remote/Flexible) IP Associate or Agent (Life Science) - Law Firm - Chicago, IL; Salt Lake City, UT; Milwaukee, Madison, Waukesha, WI; Raleigh, NC Experienced Patent Attorney - Law Firm - Washington, D.C. Patent Attorney, Electrical or Computer Engineering - Law Firm - Salt Lake City, Remote or Hybrid
{ "redpajama_set_name": "RedPajamaCommonCrawl" }
6,929
El Kara Zhorga (en kazakh i literalment, pelatge dels cavalls) o Kara Zhorgo (en kirguís) és un tipus de dansa folklòrica kazakh, kirguís i/o xinesa (l'origen és discutit), en la qual un ballarí representa la figura d'un genet experimentat a través dels moviments de ball. Malgrat que inicialment era considerada una dansa masculina, gradualment va anar sent ballada per dones. Es considera, generalment, que el ball promou l'equitació i destaca pels seus matisos i tècnica respecte d'altres balls. Hi ha diferents formes d'executar i anomenar el ball, sobretot depenent de la regió on és ballat. Per exemple, al Kazakhstan oriental es balla en parella, mentre que a la regiò càspia s'anomena Saitan kon (literalment, dimoni diví o celestial). És considerada una de les 18 danses oblidades dels kazakhs. Actualment es pot veure durant festes i casaments nacionals. El ball per regió Kazakhstan El ball era una de les 18 dances oblidades dels kazakhs fins que Arystan Shadetuly, un kazakh originari de la Xina va retornar al seu país l'any 1995. A partir de llavors, es va donar el resorgiment de la dansa, amb un auge durant la dècada de 2010, sobretot pel ressò fet als mitjans de comunicació i a internet. Kirguizistan Segons molts kirguizos, el Kara Zhorgo no té un origen kazakh, sinó que és una dansa folcklòrica kirguís amb mil anys de tradició que es va preservar a la Xina per part dels kirguís que hi habitaven. Xina La revista National Geographic de 1954 va registrar la dansa representada per kazakhs; encara avui en dia és popular entre aquests i és representada en diferents esdeveniments i, fins i tot és inclosa als plans d'estudis de les escoles kazakhs xineses. Controversia sobre l'origen Segons la historiadora i doctora en ciències Gulnara Mendikulova, el Kara Zhorga mai va ser una dansa kazakh i va ser adoptada per ells dels xinesos, i per primera vegada la dansa es va representar en l'obra Ayman - Sholpan amb el tema Kara Zhorga. Segons ella, no hi ha fonts sobre la presència de balls masculins entre els kazakhs, i per primera vegada va veure la dansa Kara Zhorga interpretada per kazakhs de la Xina a Istanbul. El professor de la Universitat Nacional de les Arts del Kazakhstan Tagzhan Izim no és tan categòric en les seves declaracions; segons ell, el ball era una dansa folklòrica que va adoptar el nom de Kara zhorga després de ser representada a l'obra de teatre esmentada anteriorment, Aiman - Sholpan, l'any 1934. L'historiador i etnògraf Zhagda Babalykuly assenyala que la dansa moderna kara zhorga no hauria d'executar-se en absolut amb la melodia Kara zhorga, sinó amb un altra música anomenada Salkurek. Segons ell, el Kara Zhorga hauria de ser un ball lent i mesurat, i no ràpid i intens com ho és actualment. Alimgazy Dauletkhan se'n fa ressò i assenyala que la melodia moderna amb la que s'interpreta el Kara Zhorga no és més que una melodia modificada del Salkuren, creada per a celebracions i dies festius. A causa de les opinions oposades sobre la dansa Kara zhorga entre la població, un dels residents del Kazakhstan li va demanar a el ministre de Cultura i Esports, Arystanbek Mukhamediuly, que aclarís la situació sobre la dansa. En la seva resposta, el ministre va rebutjar qualsevol declaració sobre el ball, perquè no era de la competència del seu ministeri, i va recomanar posar-se en contacte amb els instituts d'investigació pertinents del Ministeri d'Educació i Ciència del Kazakhstan. Referències Danses tradicionals Cultura del Kazakhstan Cultura de la Xina
{ "redpajama_set_name": "RedPajamaWikipedia" }
7,733
Q: Autowired component null pointer exception when calling method from another class I have a class with an Autowired component and a method. If I directly call the method, it works fine. But if the call to the method is from another class, then I got a java.lang.NullPointerException error in the line where the Autowired component is used. The Autowired component is an interface component that acts as a proxy. I have tried different annotations for both the interface component and the autowired component, but still getting the error. I don't get why the Autowired component is not null if the method is called directly but it's null if called from another class. This is the interface component @FeignClient(name = "authentication-server", url = "localhost:8010") public interface AuthenticationProxy { @GetMapping("/headers") public HttpEntity<String> retrieveHeaders(); @GetMapping("/auth-token") public AuthorizationTokenBean retrieveToken(); This is the class using the Autowired component @RestController public class UserController { @Autowired private AuthenticationProxy authenticationProxy; @PostMapping("/user/create") public UserResponseBean createUser(ValuesBean userValues) { UserCreateRequestBean bodyBean = new UserCreateRequestBean(); ValuesBean valuesBean = new ValuesBean(); bodyBean.setValues(userValues); // This line triggers the null pointer error // (only if method called from another class) String token = authenticationProxy .retrieveToken() .getAuthorizationToken(); HttpHeaders headers = new HttpHeaders(); headers.add("Authorization", token); headers.add("Content-type", "application/json"); headers.add("accept", "application/json"); HttpEntity<Object> requestEntity = new HttpEntity<>(bodyBean, headers); ResponseEntity<String> responseEntity = new RestTemplate().exchange( "https://api.acme.com/user/create", HttpMethod.POST, requestEntity, String.class ); String output = responseEntity.getBody(); Gson gson = new Gson(); return gson.fromJson(output,UserResponseBean.class); } } This is the class from where the method is called @RestController public class TestController { @GetMapping("/test/user/create") public void testUserCreate() { ValuesBean valuesBean = new ValuesBean(); valuesBean.setDate_of_birth("1917-05-16"); valuesBean.setFirst_name("Juan"); valuesBean.setLast_name("Rulfo"); valuesBean.setGender("Male"); valuesBean.setOccupation("Escritor"); UserController testUser = new USerController(); testUSer.createUser(valuesBean); } } A: First of all: there is no magic in this world. Dependency injection is possible only due to dependency injection framework and Spring provides one of them. When instancing a class using: UserController testUser = new UserController(); You aren't using any dependecy injection framework only pure Java object instanciation. So you can't expect @Autowired fields to be populated by magic. The code below can populate @Autowired fields in a java object instance: @Autowired private ApplicationContext applicationContext; ... UserController bean = new UserController(); AutowireCapableBeanFactory factory = applicationContext.getAutowireCapableBeanFactory(); factory.autowireBean( bean ); But i think what you're aiming is using the UserController already instanciated by Spring instead of a new instance created by you. So the code below may be what you're realy after: @RestController public class TestController { @Autowired private UserController testUser; @GetMapping("/test/user/create") public void testUserCreate() { ValuesBean valuesBean = new ValuesBean(); valuesBean.setDate_of_birth("1917-05-16"); valuesBean.setFirst_name("Juan"); valuesBean.setLast_name("Rulfo"); valuesBean.setGender("Male"); valuesBean.setOccupation("Escritor"); testUser.createUser(valuesBean); } } A: Solved! The problem was that I was manually instantiating the component called from the outer class, instead of autowiring it. @RestController public class TestController { @Autowired UsersController usersController; @GetMapping("/test/user/create") public void testPolicyholderCreate() { ValuesBean valuesBean = new ValuesBean(); valuesBean.setDate_of_birth("1917-05-16"); valuesBean.setFirst_name("Juan"); valuesBean.setLast_name("Rulfo"); valuesBean.setGender("Male"); valuesBean.setOccupation("Escritor"); usersController.createUser(valuesBean); } }
{ "redpajama_set_name": "RedPajamaStackExchange" }
1,691
{"url":"https:\/\/wushouyuan.com\/","text":"# POJ3279 Fliptile\n\n## Description\n\nFarmer John knows that an intellectually satisfied cow is a happy cow who will give more milk. He has arranged a brainy activity for cows in which they manipulate an M \u00d7 N grid (1 \u2264 M \u2264 15; 1 \u2264 N \u2264 15) of square tiles, each of which is colored black on one side and white on the other side.\n\n# \u5de5\u7a0b\u4f26\u7406 \u7b2c\u4e09\u7ae0 \u4f5c\u4e3a\u65b9\u6cd5\u7684\u4f26\u7406\u7406\u8bba\n\n## 3.1 \u906d\u9047\u4f26\u7406\u56f0\u5883\n\n\u2022 \u5b58\u5728\u4e24\u79cd\u6216\u66f4\u591a\u7684\u9053\u5fb7\u8d23\u4efb\u3001\u4e49\u52a1\u3001\u6743\u5229\u3001\u5584\u3001\u6216\u4e00\u79cd\u4ef7\u503c\u7406\u5ff5\u4e0e\u53e6\u4e00\u4ef7\u503c\u7406\u5ff5\u53d1\u751f\u51b2\u7a81\n\u2022 \u5728\u67d0\u4e00\u79cd\u7279\u5b9a\u7684\u5de5\u7a0b\u5b9e\u8df5\u60c5\u5f62\u4e2d\uff0c\u4e00\u79cd\u9053\u5fb7\u539f\u5219\u5b58\u5728\u4e24\u79cd\u6216\u4e24\u79cd\u4ee5\u4e0a\u4e0d\u76f8\u5bb9\u7684\u5e94\u7528\u65b9\u5f0f\n\u2022 \u4eba\u7c7b\u751f\u6d3b\u672c\u8eab\u7684\u590d\u6742\u6027\u4ee5\u53ca\u4ef7\u503c\u6807\u51c6\u7684\u591a\u5143\u5316\uff0c\u4f7f\u5f97\u5de5\u7a0b\u5b9e\u8df5\u7684\u4f26\u7406\u56f0\u5883\u5e38\u5e38\u5177\u6709\u4e00\u79cd\u4e0d\u786e\u5b9a\u6027\uff0c\u5373\u6211\u4eec\u5f80\u5f80\u4e0d\u80fd\u5728\u6b63\u786e\u4e0e\u9519\u8bef\u3001\u662f\u4e0e\u975e\u4e4b\u95f4\u8fdb\u884c\u6289\u62e9\n\n# POJ3276 Face The Right Way\n\n## Description\n\nFarmer John has arranged his N (1 \u2264 N \u2264 5,000) cows in a row and many of them are facing forward, like good cows. Some of them are facing backward, though, and he needs them all to face forward to make his life perfect.\n\n# POJ2010 Moo University - Financial Aid\n\n## Description\n\nBessie noted that although humans have many universities they can attend, cows have none. To remedy this problem, she and her fellow cows formed a new university called The University of Wisconsin-Farmside,\"Moo U\" for short.\n\n# priority_queue \u7684\u4f7f\u7528(C++)\n\n\u2022 \u63d2\u5165\u4e00\u4e2a\u6570\u503c\n\u2022 \u53bb\u9664\u6700\u5c0f\uff08\u5927\uff09\u7684\u6570\u503c\uff08\u83b7\u5f97\u6570\u503c\uff0c\u5e76\u4e14\u5220\u9664\uff09\n\n# POJ1064 Cable master\n\n## Description\n\nInhabitants of the Wonderland have decided to hold a regional programming contest. The Judging Committee has volunteered and has promised to organize the most honest contest ever. It was decided to connect computers for the contestants using a \"star\" topology - i.e. connect them all to a single central hub. To organize a truly honest contest, the Head of the Judging Committee has decreed to place all contestants evenly around the hub on an equal distance from it.","date":"2020-03-28 14:27:05","metadata":"{\"extraction_info\": {\"found_math\": true, \"script_math_tex\": 0, \"script_math_asciimath\": 0, \"math_annotations\": 0, \"math_alttext\": 0, \"mathml\": 0, \"mathjax_tag\": 0, \"mathjax_inline_tex\": 0, \"mathjax_display_tex\": 0, \"mathjax_asciimath\": 1, \"img_math\": 0, \"codecogs_latex\": 0, \"wp_latex\": 0, \"mimetex.cgi\": 0, \"\/images\/math\/codecogs\": 0, \"mathtex.cgi\": 0, \"katex\": 0, \"math-container\": 0, \"wp-katex-eq\": 0, \"align\": 0, \"equation\": 0, \"x-ck12\": 0, \"texerror\": 0, \"math_score\": 0.18889352679252625, \"perplexity\": 4364.174806198794}, \"config\": {\"markdown_headings\": true, \"markdown_code\": true, \"boilerplate_config\": {\"ratio_threshold\": 0.18, \"absolute_threshold\": 20, \"end_threshold\": 15, \"enable\": true}, \"remove_buttons\": true, \"remove_image_figures\": true, \"remove_link_clusters\": true, \"table_config\": {\"min_rows\": 2, \"min_cols\": 3, \"format\": \"plain\"}, \"remove_chinese\": true, \"remove_edit_buttons\": true, \"extract_latex\": true}, \"warc_path\": \"s3:\/\/commoncrawl\/crawl-data\/CC-MAIN-2020-16\/segments\/1585370491998.11\/warc\/CC-MAIN-20200328134227-20200328164227-00298.warc.gz\"}"}
null
null
The stories that matter to you, told by you, to millions of readers. No spin. No agendas. Just news by you, for you. Join iPatriot as a featured writer below. Join iPatriot Like Follow Plus Leftist Radicals Just Want to Watch the World Burn The Common Constitutionalist Scroll Down for Audio Version As the president pointed out in his latest press conference, the original group that was protesting the removal of the Robert E. Lee statue actually had a permit to assemble and did so peacefully. The leftist/Marxist radicals did not obtain a permit. Now I don't care who you are. If you assemble peacefully and conduct yourself accordingly – you can be Communist/Marxist radicals or fascist skin head, neo-Nazis. Who cares. But when you cross the line and descend into violence, it should matter who you are. Trending: What Do Progressive Democrats Believe? As Tucker Carlson pointed out on his Tuesday evening Fox News program, it evidently it does matter who you are, or with what wacko group you belong. Completing this poll grants you access to updates free of charge. You may opt out at anytime. You also agree to this site's Privacy Policy and Terms of Use. Many of us witnessed the outrageous behavior in Durham, NC, of the black lady climbing a ladder to place a lanyard around a Civil War soldier's memorial. The crowd had no permit, no permission to even be there, much less the authority to pull down the statue, however offensive they all of the sudden thought it to be. I say all of the sudden, because a lot of these statues have been on display for a century or so, and no one said boo. Not blacks or whites – left or right. Now we're expected to believe that a mass consciousness awakening has spontaneously occurred like so many newborn puppies opening their eyes for the first time. Bull Crap! And may I add – what if she would have fallen? We all know exactly what would have happened. She would have sued the city of Durham and won. Just where were the cops during this lawless display? I'll tell you where they were. They were somewhere nearby, sitting on their hands because they were ordered to by leftist local politicians, who are either as radical as the hell-raisers who tore down the statue, but don't dare reveal themselves – or too cowardly to act against them. Van Jones has been oft quoted as saying, "I'm willing to forgo the cheap satisfaction of the radical pose for the deep satisfaction of radical ends." This could be the leftist politician's creed, for it seems the left political class is the last bastion of covert Marxism. The mask has come off virtually everyone else – from the ex-hippie turned grandparent, to the ignorant, idealistic student, to the long-tenured University professor. All have succumbed to allure of the revolution. Yet the political class still puts on airs to hide their radicalism – or again, is too cowardly to speak out. Oh, we catch glimpses of Marxism in times of weakness and irrationality. Just watch most speeches by Maxine Waters. But for the most part, leftist politicians have done a decent job at keeping their most vile views under wraps – but only relative to their constituents. In years gone by, leftist politicians felt they had to hit the streets, give speeches and go to rallies to whip up a crowd. Not anymore. The crowd has passed them by. The Marxist ideal of shutting down and destroying anything and everything that offends the movement has developed a life of its own. This rudderless ship no longer needs political leadership, except for the ones capable of holding the authorities at bay. The movement is feeding on its own energy. And liberal politicians had better be aware of the monster they have helped create. There may come a day when the crowd realizes that they no longer need you either – or that the John Lewis' and Maxine Waters' of the nation just aren't radical enough. Then the mob will consume them. I agree with president Trump, that enough will never be enough for this rabble. They will become like the Palestinian terrorists. No matter what Israel offers them for the sake of peace, or how much land they are willing to vacate, it is never enough for the lying Palestinian leadership. In the Batman movie, The Dark Knight, Alfred is talking to Bruce Wayne about the Joker. Alfred says to Bruce: "Perhaps this is a man you don't fully understand… Some men aren't looking for anything logical. Some men can't be bought, bullied, reasoned or negotiated with. Some men just want to watch the world burn." That is the definition of the radicals of the Antifa movement and their idiot followers in the new alt-left. They don't want peace. They don't know what they want. Only what they don't want. The opinions expressed in this commentary are solely those of the author and are not not necessarily either shared or endorsed by iPatriot.com. Brent Smith, aka The Common Constitutionalist, is a constitutional conservative who advocates for first principles – the founders' original intent and enemy of progressives. He is former Navy and a martial arts expert. Smith considers himself just an average Joe with no formal journalism background – but rather than simply complain about the state of our nation, he took to the Internet to battle the left. America Enters a Season in HellWhite Supremacy vs. Black Supremacy iPatriot Trending on iPatriot Obama: The Most Corrupt and America-Hating President in U.S. History George Soros Can Be Charged With Treason and Sedition Democrats: The Party of Hate, Violence, and Division YouTube Goes Full Police-State Search News by State Subscribe and Get News by you. For you. Need help, have a question, or a comment? Send us an email and we'll get back to you as soon as possible. Copyright © 2021 iPatriot.com. All Rights Reserved. Terms & Conditions | Privacy Policy | About iPatriot | Contact iPatriot Login with Facebook OR
{ "redpajama_set_name": "RedPajamaCommonCrawl" }
8,191
Gallerist at Home: Monique Meloche Hip, stylish, and ever-tasteful, Monique Meloche (the founder, owner, and namesake of monique meloche gallery) and her husband live in a contemporary single family home in Ukranian Village, Chicago. After Meloche and her husband got married and moved into their home, they opened the gallery in that very residence in October of 2000 with an exhibition aptly called "Homewrecker" before opening to the public in 2001. Rashid Johnson, Thug, 2000, neon and mahogany, 48 x 48 in. Image courtesy of artist and moniquemeloche; Photography by Heidi Norton. Twelve years later, Meloche is still a tastemaker in the art world and gallery circuit. Meloche also founded Gallery Weekend Chicago, an annual fall art fair that runs from September 21-23rd this year. Having started the gallery in her home, Meloche is a perfect candidate for Gallerist at Home, as she is constantly testing and blurring the lines between personal and private -- home and gallery. - Ellen C. Caldwell Ellen Caldwell: I love the Rashid Johnson "Thug" piece and the fact that you said people know your house by the warm pink glow – that's awesome. What made you know that piece belonged in your home?Monique Meloche: This is the first piece we bought by Rashid -- in fact my husband bought it to help out a then struggling artist back in 2000! The use of pink was in reference to a body of work Rashid was working on using "Pink Lotion," a black hair-care product. This was at the starting point of our more serious art collecting and certainly fits in with our very strong interest in African-American artists. Living Room: featuring works: Wesley Kimler, 1999, acrylic on paper and Rashid Johnson, The New Negro Escapist Social and Athletic Club (Thurgood). Images courtesy artist and moniquemeloche. Rashid Johnson, The New Negro Escapist Social and Athletic Club (Thurgood), 2008, Lambda print, 69 x 55 1/2 in. Image courtesy artist and moniquemeloche. EC: And the unconventional pool-over-dining table is a great conversation piece, I am sure. You have clearly created and cultivated this part of your house for hosting. How did you choose the artwork for the larger backdrop of this dynamic social scene? (Or what about the Johnson and Kimler pieces are felt fitting there?) MM: Besides opening the front door and seeing THUG, this is the most dramatic viewing spot in the house. We have a vintage 1966 Brunswick pool table instead of formal dining room and do most of my post-opening dinners at my home with artists, collectors, curators playing pool. Kimler offered to make us a piece as a wedding/housewarming gift, and if you know him you would not be surprised that he chose the largest wall we have and it has been there ever since. Several pieces have graced the back wall behind the pool table, but once we acquired the The New Negro Escapist Social and Athletic Club (Thurgood)photo, it just belonged there. More practically, all the work is glazed in this area since pool cues often graze the plexi. Rashid Johnson, Black Love, 2008, black soap and wax with shea butter, incense, brass objects and vinyl albums, 4 x 8 feet. Image courtesy of artist and moniquemeloche. EC: Clearly you are a big Rashid Johnson fan, as am I. Do you represent him? MM: I have represented Rashid Johnson since I opened my gallery in 2001 and we still do! We always collect work from the artists that I show, so you will always see work by gallery artists in my home alongside work by Luc Tuymans, Kehinde Wiley, Zac Prekop, Mark Flood, Michalene Thomas, Jonas Wood, Jeff Sonhouse, and Rachel Niffeneggerto name a few. Jason Middlebrook, Double Negative 1969-1970, 2003, watercolor, graphite, and acrylic on paper (in 2 parts) , 80 x 111 in. overall. Image courtesy of artist and moniquemeloche. EC: That's a great collection. Your Middlebrook piece is fantastic. What's the story behind its journey to your house? MM: My husband noticed this piece was coming up at auction and was intrigued. We had just starting representing Jason Middlebrook and already had a wood sculpture in our collection, so adding a large-scale work on paper seemed like a nice addition. The piece is so visually striking and the content in reference to Michael Heizer's seminal earthwork sums up so much of Jason's work. My husband was convinced that it would be perfect over the dining table, so we took out the measuring tape and thought it would be nice to push the boundaries of scale to the limit and it worked! His MTA mosaic tile installationin Brooklyn was just voted best new public art in the USA!! Rinus Van de Velde, Please Not Now, 2009, Siberian charcoal on paper, 59 x 43 in. Image courtesy of artist and moniquemeloche. EC: I love that Rinus Van de Velde's work inspired you to purchase work for your home, while also signing him. MM: As I mentioned, our collecting is a wonderful representation of the gallery program that is rounded out by a diverse selection of non-gallery artists. Rinus Van de Veldeis a young Belgian artist whom we discovered at Art Basel Miami Beach. We bought this on the spot and then offered him a show last year! Carrie Schneider, Pines from the series "Derelict Self", 2006-2007, C-print, 36 x 30 in. Image courtesy of artist and moniquemeloche. EC: Schneider's series is so interesting. Can you tell me more about her goals with the series and what drew you to it? MM: Carrie Schneider's Derelict Self series was the first works I saw in her MFA show from The School of the Art Institute of Chicago. Although not really self-portraits, Schneider is always present in her photos, videos, and films. This is a series of ten photos in which she mimicked her brother's movements—in this one she has literally climbed into the same sweater as him. I love this because it is about sibling rivalry but also about adoration or emulation of siblings, as she is his subconscious body double. Quoting the artist, "Derelict Selfis inspired by the idea that mimicry can be a way to both gain and lose a sense of oneself, as well as my own experience of being a younger sibling." Gallery installation view of Burning House. Image courtesy of artist and moniquemeloche. Home interior view. Image courtesy of artist and moniquemeloche. --- After curating at Chicago's MCA and directing both Rhona Hoffman and Kavi Gupta galleries, Monique Meloche opened her own space in 2001. Meloche founded Gallery Weekend Chicago, which will once again bring collectors and curators from across the globe to Chicago in September 2012. Upcoming exhibits at the gallery include art by Joel Ross and Justin Cooper. Ellen C. Caldwell is an LA-based art historian, editor, and writer. Carrie Schneider Ellen C. Caldwell Jason Middlebrook monique meloche Rinus Van de Velde Van de Velde Wesley Kimler
{ "redpajama_set_name": "RedPajamaCommonCrawl" }
3,284
Radio Złote Przeboje (kurz: Złote Przeboje, Goldene Schlager) ist ein überregionales Rundfunknetzwerk in Polen. Gegründet wurde es 1997. Es war ursprünglich, wie beispielsweise aus den USA bekannt, ein Netzwerk unabhängiger lokaler Sendestationen, die (zentral in Warschau) ein gemeinsames Mantelprogramm produzierten. Złote Przeboje hat eine Sendelizenz für die Zulieferung eines landesweiten Mantelprogramms, verfügt also nicht über eigene Sender. Bis etwa 2007 erfolgte die Neugründung als zentral organisierter landesweiter Sender. Die Marke gehört zur Agora Radio Group, eine 100-prozentige Gesellschaft der Agora S.A. (Medienbeteiligungsgesellschaft). Mit der Aufgabe der eigenen Homepage wurde die gesamte technische Infrastruktur für die Verbreitung des Internetstreams (mainstream.radioagora.pl) einschließlich der neuen Homepage in Tuba.pl, ebenfalls eine Gesellschaft der Agora S.A., integriert. Programm Das Programm bietet ein durchhörbares Formatradio mit den erfolgreichsten aktuellen Hits. (Przeboje, also Schlager, wird im Polnischen im Sinne von "erfolgreichste Hits" verstanden.) Dazu kommen noch zu einem geringen Anteil Oldies seit den 60er Jahren, die früher ursprünglich den Hauptteil des Programms ausgemacht haben. Die Kernzielgruppe hat sich damit auf die 30- bis 50-jährigen Radiohörer verlagert. Von 2007 bis Januar 2010 gehörte der bekannte Marek Niedzwiecki, zuvor und danach Musikredakteur und Moderator beim 3. Programm des Polnischen Rundfunks, mit seiner Chart-Show zum Moderatorenteam. Lokale/regionale Studios Fensterprogramme werden aus Studios der folgenden Orte gesendet: Białystok, Bydgoszcz, Częstochowa, Gdańsk, Jelenia Góra, Katowice, Krakau, Lublin, Łódź, Nowy Sącz, Opole, Poznań, Rzeszów, Szczecin, Wałbrzych, Warschau, Wrocław, Zamość, Zielona Góra. Diese Stationen stellen das regionale Programm mit eigener Werbung, Regionalnachrichten, Wetter und Serviceinformationen zusammen. Internetsender Der Sender bietet über seine Homepage folgende weitere Internetprogramme an: Złote Przeboje Pop Złote Przeboje Rock Złote Przeboje Disco/Dance Złote Przeboje Po Polsku (nur polnische Musik) Złote Przeboje Ballady (Balladen) Empfang Über 25 UKW-Sender werden ca. 70–75 Prozent des polnischen Staatsgebiets (über 90 Prozent der Bevölkerung) versorgt: Białystok (101,0 MHz), Bydgoszcz (92,1 MHz), Częstochowa (96,6 MHz), Gdańsk (103,0 MHz), Gdynia (99,2 MHz), Gorlice (99,6 MHz), Jelenia Góra (106,2 MHz), Katowice (91,2 MHz), Kraków (92,5 MHz), Lublin (95,6 MHz), Łódź (101,3 MHz), Nowy Sącz (93,8 MHz), Nowy Targ (91,3 MHz), Opole (92,8 i 104,1 MHz), Poznań (88,4 MHz), Rzeszów (95,7 MHz), Szczecin (89,8 MHz), Wałbrzych (91,8 MHz), Warszawa (100,1 MHz), Wolin (105,6 MHz), Wrocław (90,4 MHz), Zabrze (96,6 MHz), Zamość (99,3 MHz), Zielona Góra (98,1 MHz), Żary (94,4 MHz) Weiterhin wird das Programm über den Satelliten Hot Bird 8 (Regionalprogramm 100.1 FM, Warschau) ausgestrahlt und über mehrere regionalisierte Internetstreams. Einzelnachweise Hörfunk (Polen) Medien (Warschau)
{ "redpajama_set_name": "RedPajamaWikipedia" }
3,078
by Chris Littlefield with Ross Hecox Versatility is the cornerstone of my program. I like to train horses that aren't specialized for one event, but instead are able to perform in a variety of competitions. One of the most important things you can do for your horse is to make sure his saddle fits properly. Poorly fitting tack is equal to poorly fitting shoes: too tight and you've got squished toes and painful feet, too loose and you've got blisters. Have not been able to ride much this winter. Wanting to start showing my horses this spring. I need tips on warming horses up before doing any Western Riding exercises.
{ "redpajama_set_name": "RedPajamaC4" }
9,902
Grethiwha's c-blog Posts 1Blogs 36Following 0Followers 16 The Top 25 All-Time Best Wii Games (#20-16) 7:40 PM on 09.09.2012 (server time) 0 Part two of my 25 best games... of the Wii... of all-time... list! It's here already! I already introduced the list in part one, so I don't really know what to write here. Did I mention that I'm not including Virtual Console games on this list – but I am including ports, and right high up too, like they weren't even ports? Awesome, right?! But for the record, my favourite game I played on VC is Wave Race 64. Followed by Harvest Moon for the SNES. #20! The Legend of Zelda: Twilight Princess The first major Wii game – this is what I, as many other people were, was most excited about of everything at launch. I actually got the game one month before I actually got the Wii system, and I was ridiculously excited to actually be able to play it. When I was finally able to play it, I played it feverishly for a while. I actually loved the then-novel controls. And the game was in general fantastic. And also there was fishing. It didn't live up to the N64 Zelda games, nor The Wind Waker which I didn't play until later, but it's still an outsanding and seminal game in the Wii's library – and I believe it's the first Zelda game I ever saw through to the end. #19. Red Steel 2 No game has made me feel more like a gunslinger than this game thanks to some of the best FPS IR controls on the system. Even opening boxes is incredibly fun, because you have to shoot the latches off and you can ricochet bullets off walls to do it. It's awesome! But the swordplay – this game features the most satisfying swordplay I've ever experienced in a game. Red Steel 2 was the first game (and is still pretty much the only game besides Skyward Sword) to truly put the Wii Motion+ to good use in the context of a full gaming experience. And it works so well! I felt like I was playing a launch game for a brand new system – like I felt when I first used the Wii Remote in Twilight Princess and Wii Sports; it was so much evolved from the standard Wii motion controls – it was exhilarating. The game reconciles the Western-style gunplay and the Eastern-style swordplay beautifully. Did I mention the gorgeous cel-shaded art style and the 60 frames per second? #18. Super Mario Galaxy 2 2 is every bit as good as the first Galaxy. I only place it a bit lower for the lack of originality. But even so, when the original is the most beautiful, polished, and innovative platformer of the console generation, it's hard to complain about 'more of the same'. Besides, it features some of the most memorable levels of both games, like the 'Slimy Spring' galaxy and the Mario 64 throwback galaxy. And there are some new power-ups and stuff. And it doesn't have the ridiculously frustrating purple coin levels at the end, to boot. I don't think anyone's going to argue with this game's inclusion on this list. #17. World of Goo This is a totally unique and ingenious physics-based puzzle game that could not have been done on a standard controller. It's perfectly suited for IR controls. But the presentational aspects of this game – the music, the writing, the atmosphere – are what truly push it over the top, and they're way beyond any other puzzle game that I can think of. World of Goo is generally considered Wiiware's essential game for very good reason. #16. Muramasa: The Demon Blade This, a Wii game, is the most beautiful game of the console generation. The hand-drawn Traditional Japanese-style art looks pretty much perfect in 480p. The combat and light RPG elements are incredibly fun. And I think it's super cool in the way it presents samurai culture and ancient Japanese mythology. Anyway, I wrote a whole blog about this game a couple months ago, so you can read that if you'd like! Stay tuned for the reveal of the next five games, some time in the next week hopefully maybe! < PREVIOUS FIVE GAMES ----- NEXT FIVE GAMES > Grethiwha InsertTokenz 1 WolfyBoey 1 About Grethiwhaone of us since 12:06 PM on 12.01.2010 My Favourite Games: The Legend of Zelda: The Wind Waker Ōkami Killer 7 Other things I like: My Favourite Movies: My Favourite Books: My Favourite Musics: Select Blogography: Ah, Garcian. How long has it been? A LittleBigPlanet Retrospective DAWN OF A NEW DAY The Top 25 All-Time Best Wii Games Love-de-Lic & the most talented Japanese game devs whose games I can't play... The Definitive List of the Top 10 Nintendo Characters Grethiwha's Top Ten Favourite Musical Albums of All the Time and also DS Games PSN ID: Grethiwha Follow Grethiwha
{ "redpajama_set_name": "RedPajamaCommonCrawl" }
9,588
XML to JSON is an Android Studio Library which converts easily **XML to JSON** and **JSON to XML**. It is fully **configurable** so that you can change for example attribute names. It is easy to integrate with **gradle**. ## XML to JSON ## ### Basic usage ### There are 2 ways to create a **XmlToJson** object: from a **String** or from an **InputStream**. ```java String xmlString; // some XML String previously created XmlToJson xmlToJson = new XmlToJson.Builder(xmlString).build(); ``` OR ```java AssetManager assetManager = context.getAssets(); InputStream inputStream = assetManager.open("myFile.xml"); XmlToJson xmlToJson = new XmlToJson.Builder(inputStream, null).build(); inputStream.close(); ``` Then you can convert it to a **JSONObject**, a **String**, or a **Formatted String** (with indentation and line breaks). ```java // convert to a JSONObject JSONObject jsonObject = xmlToJson.toJson(); // convert to a Json String String jsonString = xmlToJson.toString(); // convert to a formatted Json String String formatted = xmlToJson.toFormattedString(); ``` Thats' it. Here is an example of XML... ```xml <?xml version="1.0" encoding="utf-8"?> <library> <owner>John Doe</owner> <book id="007">James Bond</book> <book id="000">Book for the dummies</book> </library> ``` ... converted into JSON ```json { "library":{ "owner": "John Doe", "book":[ { "id":"007", "content":"James Bond" }, { "id":"000", "content":"Book for the dummies" } ] } } ``` ### Custom Content names ### By default, the content of a XML Tag is converted into a key called "content". This name can be changed with a custom one, using **Builder.setContentName**(String contentPath, String replacementName). You can change as many content names as you want. ```xml <?xml version="1.0" encoding="utf-8"?> <library> <book id="007">James Bond</book> <book id="000">Book for the dummies</book> </library> ``` ```java public String convertXmlToJson(String xml) { XmlToJson xmlToJson = new XmlToJson.Builder(xml) .setContentName("/library/book", "title") .build(); return xmlToJson.toString(); } ``` ```json { "library":{ "book":[ { "id":"007", "title":"James Bond" }, { "id":"000", "title":"Book for the dummies" } ] } } ``` ### Custom Attributes names ### Attributes are converted into key / values in the JSON. The attribute names may conflict with other keys. You can change the name of any attribute, by specifying the path to the attribute and the replacement name, using **Builder.setAttributeName**(String attributePath, String replacementName). ```xml <?xml version="1.0" encoding="utf-8"?> <library> <book id="007">James Bond</book> <book id="000">Book for the dummies</book> </library> ``` ```java public String convertXmlToJson(String xml) { XmlToJson xmlToJson = new XmlToJson.Builder(xml) .setAttributeName("/library/book/id", "code") .build(); return xmlToJson.toString(); } ``` ```json { "library":{ "book":[ { "code":"007", "content":"James Bond" }, { "code":"000", "content":"Book for the dummies" } ] } } ``` ### Force a Tag to be a list ### In a XML hierarchy, an entry can have children. For example, \<library> has 2 entries \<book>. In case there is only one book, there is no way to know that Book is a list. But you can force it using **Builder.forceList**(String path). ```xml <?xml version="1.0" encoding="utf-8"?> <library> <book id="007">James Bond</book> </library> ``` By default, the \<book> tag is NOT considered as a list ```json { "library":{ "book":{ "id":"007", "content":"James Bond" } } } ``` ```java public String convertXmlToJson(String xml) { XmlToJson xmlToJson = new XmlToJson.Builder(xml) .forceList("/library/book") .build(); return xmlToJson.toString(); } ``` Now \<book> is considered as a list: ```json { "library":{ "book":[ { "id":"007", "content":"James Bond" } ] } } ``` ### Force a Tag or Attribute to be an Integer / Long / Double / Boolean ### By default the XML attributes or content are processed as Strings. If you want to force them to be another type (like Integer), then use on of these methods **Builder.forceIntegerForPath**(String path), **Builder.forceLongForPath**(String path), **Builder.forceDoubleForPath**(String path) or **Builder.forceBooleanForPath**(String path). ```xml <?xml version="1.0" encoding="utf-8"?> <library> <owner>John Doe</owner> <book id="007">James Bond</book> <book id="000">Book for the dummies</book> </library> ``` ```java public String convertXmlToJson(String xml) { XmlToJson xmlToJson = new XmlToJson.Builder(xml) .Builder.forceIntegerForPath("/library/book/id") .build(); return xmlToJson.toString(); } ``` ```json { "library":{ "owner": "John Doe", "book":[ { "id":7, "content":"James Bond" }, { "id":0, "content":"Book for the dummies" } ] } } ``` Here "007" and "000" are converted to 7 and 0. Note that you can use forcexxxForPath methods AND change the attribute or content name for the same path; the methods in the Builder can be combined. The path used in forcexxxForPath methods is the path in the xml before eventually changing its name. ### Skip a Tag or an Attribute ### If you are not interrested in getting all the content of the XML, you can skip some Tags or some Attributes. Like for other methods you have to provide the path for the element to skip. You can use **skipTag** and **skipAttribute** as many times as you need. ```xml <?xml version="1.0" encoding="utf-8"?> <library> <owner>John Doe</owner> <book id="007">James Bond</book> <book id="000">Book for the dummies</book> </library> ``` ```java XmlToJson xmlToJson = new XmlToJson.Builder(xml) .skipTag("/library/owner") .skipAttribute("/library/book/id") .build(); ``` ```json { "library":{ "book":[ { "content":"James Bond" }, { "content":"Book for the dummies" } ] } } ``` ## JSON to XML ## ### Basic usage ### There are several ways to create a **JsonToXml** object: from a Json **String**, a **JSONObject** or from an **InputStream**. ```java JSONObject jsonObject; // some JSONObject previously created JsonToXml jsonToXml = new JsonToXml.Builder(jsonObject).build(); ``` OR ```java String jsonString; // some JSON String previously created JsonToXml jsonToXml = new JsonToXml.Builder(jsonString).build(); ``` OR ```java AssetManager assetManager = context.getAssets(); InputStream inputStream = assetManager.open("myFile.json"); JsonToXml jsonToXml = new JsonToXml.Builder(inputStream).build(); inputStream.close(); ``` Then you can convert it to a XML String or a XML Formatted String (with indentation and line breaks) ```java // Converts to a simple XML String String xmlString = jsonToXml.toString(); // Converts to a formatted XML String int indentationSize = 3; String formattedXml = jsonToXml.toFormattedString(indentationSize); ``` Here is a JSON example ```json { "owner": { "id": 124, "name": "John Doe" } } ``` which is converted into XML ```xml <?xml version="1.0" encoding="UTF-8"?> <owner> <id>124</id> <name>John Doe</name> </owner> ``` ### Force a TAG to be an parent Attribute ### You may want to use XML Attributes instead of TAG content. You can do this by using the **forceAttribute** method. You need to specify the Path to the TAG. ```java JsonToXml jsonToXml = new JsonToXml.Builder(jsonObject) .forceAttribute("/owner/id") .build(); ``` The result becomes ```xml <?xml version="1.0" encoding="UTF-8"?> <owner id="124"> <name>John Doe</name> </owner> ``` ### Force a TAG to be a parent Content ### When a Tag has only one child, you may want that child to be the Content for its parent. You can use the **forceContent** method to achieve this. ```java JsonToXml jsonToXml = new JsonToXml.Builder(jsonObject) .forceAttribute("/owner/id") .forceContent("/owner/name") .build(); ``` The result becomes ```xml <?xml version="1.0" encoding="UTF-8"?> <owner id="124">John Doe</owner> ``` which is very compact :) ## Installation with gradle ## Add the following maven{} line to your **PROJECT** build.gradle file ``` allprojects { repositories { jcenter() maven { url "https://jitpack.io" } // add this line } } ``` Add the libary dependency to your **APP** build.gradle file ``` dependencies { implementation 'com.github.smart-fun:XmlToJson:1.5.1' // add this line } ``` ## License ## Copyright 2016-2021 Arnaud Guyon Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at [http://www.apache.org/licenses/LICENSE-2.0](http://www.apache.org/licenses/LICENSE-2.0) Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
{ "redpajama_set_name": "RedPajamaGithub" }
291
<?php namespace MainBundle\Form; use Symfony\Component\Form\AbstractType; use Symfony\Component\Form\FormBuilderInterface; use Symfony\Component\OptionsResolver\OptionsResolverInterface; use MainBundle\Entity\ProviderRepository; use MainBundle\Entity\TransportRepository; use MainBundle\Entity\DriverRepository; use MainBundle\Entity\ProductRepository; use Symfony\Component\Validator\Constraints\DateTime; class IngressType extends AbstractType { private $transport; public function __construct($transport = null) { $this->transport = $transport; } /** * @param FormBuilderInterface $builder * @param array $options */ public function buildForm(FormBuilderInterface $builder, array $options) { $nowDate = new \DateTime(); $builder->add('baln', 'text', array('label' => 'BALN', 'required' => false)) ->add('date', 'datetime', array( 'label' => 'Fecha', 'date_widget' => 'single_text', 'time_widget' => 'single_text', 'format' => 'dd/MM/yyy H:mm', 'data' => ($options['data']->getDate() != null ? $options['data']->getDate() : $nowDate) )) ->add('provider', 'entity', array( 'label' => 'Nombre', 'placeholder' => 'Elige una opción', 'attr' => array('class' => 'select2', 'style' => "width:100%"), 'class' => 'MainBundle\Entity\Provider', 'query_builder' => function (ProviderRepository $repository) { return $repository->createQueryBuilder('p') ->where('p.active = ?1') ->setParameter(1, true); } )) ->add('truckDomain', 'text', array('label' => 'Dominio Camión')) ->add('coupledDomain', 'text', array('label' => 'Dominio Acoplado')) ->add('transport', 'entity', array( 'label' => 'Nombre', 'placeholder' => 'Elige una opción', 'attr' => array('class' => 'select2', 'style' => "width:100%"), 'class' => 'MainBundle\Entity\Transport', 'query_builder' => function (TransportRepository $repository) { return $repository->createQueryBuilder('p') ->where('p.active = ?1') ->setParameter(1, true); } )) ->add('driver', 'entity', array( 'label' => 'Chofer', 'placeholder' => 'Elige una opción', 'attr' => array('class' => 'select2', 'style' => "width:100%"), 'class' => 'MainBundle\Entity\Driver', 'query_builder' => function (DriverRepository $repository) { $transportId = ($this->transport == null ? 0 : $this->transport->getId()); return $repository->createQueryBuilder('d') ->join("d.transport","t"); } )) ->add('grossWeight', 'text', array('label' => 'Peso Bruto (Kilogramos)')) ->add('tareWeight', 'text', array('label' => 'Tara (Kilogramos)')) ->add('product', 'entity', array( 'label' => 'Nombre', 'placeholder' => 'Elige una opción', 'attr' => array('class' => 'select2', 'style' => "width:100%"), 'class' => 'MainBundle\Entity\Product', 'query_builder' => function (ProductRepository $repository) { return $repository->createQueryBuilder('p') ->where('p.active = ?1') ->setParameter(1, true); } )) ->add('density', 'text', array('label' => 'Densidad corregida a 15')) ->add('tested', 'checkbox', array('label' => 'Fue analizada?', 'required' => false)) ->add('clean', 'text', array( 'label' => 'Neto (Kilogramos)', 'attr' => array('readonly' => true) )) ->add('realLiter', 'text', array( 'label' => 'Litros Reales', 'attr' => array('readonly' => true) )) ->add('branchNumber', 'text', array('label' => 'Número de sucursal', 'required' => false)) ->add('remitNumber', 'text', array('label' => 'Número de remito', 'required' => false)) ->add('observation', 'textarea', array('label' => 'Observación', 'required' => false)) ->add('distillationGout', 'text', array('label' => 'Destilación la gota (Tº)', 'required' => false)) ->add('fivePercent', 'text', array('label' => '5% (Tº)', 'required' => false)) ->add('tenPercent', 'text', array('label' => '10% (Tº)', 'required' => false)) ->add('twentyPercent', 'text', array('label' => '20% (Tº)', 'required' => false)) ->add('thirtyPercent', 'text', array('label' => '30% (Tº)', 'required' => false)) ->add('fortyPercent', 'text', array('label' => '40% (Tº)', 'required' => false)) ->add('fiftyPercent', 'text', array('label' => '50% (Tº)', 'required' => false)) ->add('sixtyPercent', 'text', array('label' => '60% (Tº)', 'required' => false)) ->add('seventyPercent', 'text', array('label' => '70% (Tº)', 'required' => false)) ->add('eightyPercent', 'text', array('label' => '80% (Tº)', 'required' => false)) ->add('ninetyPercent', 'text', array('label' => '90% (Tº)', 'required' => false)) ->add('ninetyFivePercent', 'text', array('label' => '95% (Tº)', 'required' => false)) ->add('pDry', 'text', array('label' => 'P. Seco (Tº)', 'required' => false)) ->add('pFinal', 'text', array('label' => 'P. Final (Tº)', 'required' => false)) ->add('recovered', 'text', array('label' => 'Recuperado (Porcentaje)', 'required' => false)); } /** * @param OptionsResolverInterface $resolver */ public function setDefaultOptions(OptionsResolverInterface $resolver) { $resolver->setDefaults(array( 'data_class' => 'MainBundle\Entity\Ingress' )); } /** * @return string */ public function getName() { return 'mainbundle_ingress'; } }
{ "redpajama_set_name": "RedPajamaGithub" }
6,925
Q: Equivalent to WPF DependencyProperties in Prism ViewModels I understand that the standard way in WPF to expose a custom property in XAML is to define it as DependencyProperty in the View's code-behind. However, this only works for DependencyObjects, such as a UserControl. Yet, in clean Prism fashion, my code-behind (i.e., the class deriving from UserControl) is empty, and I deal with all the logic in my view model, which derives from BindableBase, which is not a child class of DependencyObject. Consider the following XAML fragment: <MyNamespace:MyCustomView MyProperty={Binding} /> The core of MyCustomViewModel is private string myProperty; public string MyProperty { get { return myProperty; } set { SetProperty(ref myProperty, value); } I'm still relatively new to Prism. What do I do to expose a MyProperty, which is defined in my MyCustomViewModel so that I can set it in XAML with a tag similar to that above? Update Following @mm8's answer and our discussion in the corresponding comments, I developed a minimal (non-)working example of what I have in mind. A summary first: * *Data model is a list of objects. *Shell must display each of these objects by means of a custom user control for this object type. A) The shell A.1) XAML The XAML is straightforward. <Window x:Class="MyProject.Views.MainWindow" Name="MainWindowName" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:prism="http://prismlibrary.com/" xmlns:MyNamespace="clr-namespace:MyProject.Views" prism:ViewModelLocator.AutoWireViewModel="True" Title="{Binding Title}" Height="350" Width="525"> <ItemsControl ItemsSource="{Binding StringCollection, ElementName=MainWindowName}"> <ItemsControl.ItemTemplate> <DataTemplate> <MyNamespace:MyUserControl MyTargetProperty="{Binding}" /> </DataTemplate> </ItemsControl.ItemTemplate> </ItemsControl> </Window> A.2) Code-behind The code-behind contains a data model definition; in reality, I'd define this in the Models namespace, of course. using System.Collections; using System.Windows; namespace MyProject.Views { /// <summary> /// Interaction logic for MainWindow.xaml /// </summary> public partial class MainWindow : Window { public MainWindow() { InitializeComponent(); StringCollection = new ArrayList(); StringCollection.Add("String 1"); StringCollection.Add("String 2"); StringCollection.Add("String 3"); } private ArrayList stringCollection; public ArrayList StringCollection { get { return stringCollection; } set { stringCollection = value; } } } } A.3) View model The view model is the standard one provided with the Prism code templates. using Prism.Mvvm; namespace MyProject.ViewModels { public class MainWindowViewModel : BindableBase { private string _title = "Prism Unity Application"; public string Title { get { return _title; } set { SetProperty(ref _title, value); } } public MainWindowViewModel() { } } } B) The custom user control This is where the fun starts. In the end, I'd like to have access to the MyTargetProperty in the MyUserControlViewModel, since I want to invoke sophisticated program logic on it that depends on other work with the data model, and is thus not to be placed in the code-behind. B.1) XAML Very naive; only contains a label. <UserControl x:Class="MyProject.Views.MyUserControl" Name="UserControlName" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:prism="http://prismlibrary.com/" prism:ViewModelLocator.AutoWireViewModel="True"> <Label Content="{Binding MyTargetProperty, ElementName=UserControlName}" Background="AliceBlue"/> </UserControl> B.2) Code-behind This is where I declare the target property as DependencyProperty, as suggested in @mm8's answer. using System.Windows; using System.Windows.Controls; namespace MyProject.Views { /// <summary> /// Interaction logic for MyUserControl /// </summary> public partial class MyUserControl : UserControl { public MyUserControl() { InitializeComponent(); } public static readonly DependencyProperty MyTargetPropertyProperty = DependencyProperty.Register("MyTargetProperty", typeof(string), typeof(MyUserControl)); public string MyTargetProperty { get { return (string)GetValue(MyTargetPropertyProperty); } set { SetValue(MyTargetPropertyProperty, value); } } } } B.3) View model The view model defines the source property. using Prism.Mvvm; namespace MyProject.ViewModels { public class MyUserControlViewModel : BindableBase { public MyUserControlViewModel() { } private string mySourceProperty; public string MySourceProperty { get { return mySourceProperty; } set { SetProperty(ref mySourceProperty, value); } } } } I can't for the life of me figure out how to access the values I set in the MainWindow's ItemTemplate within the MyUserControl's view model. A: Only target (view) properties must be dependency properties. So for you to be able to bind anything to such a property, it must be a dependency property like MyProperty in this case: <MyNamespace:MyCustomView MyProperty="{Binding SourceProperty}" /> A source property in a view model may however be a plain CLR property: public string SourceProperty { get; set; } So your view models don't have to (and shouldn't!) inherit from DependencyObject but views should.
{ "redpajama_set_name": "RedPajamaStackExchange" }
735
package org.kie.dmn.core.v1_3; import java.math.BigDecimal; import java.util.Map; import org.junit.Test; import org.kie.dmn.api.core.DMNContext; import org.kie.dmn.api.core.DMNModel; import org.kie.dmn.api.core.DMNResult; import org.kie.dmn.api.core.DMNRuntime; import org.kie.dmn.api.core.FEELPropertyAccessible; import org.kie.dmn.core.BaseVariantTest; import org.kie.dmn.core.api.DMNFactory; import org.kie.dmn.core.impl.DMNContextFPAImpl; import org.kie.dmn.core.util.DMNRuntimeUtil; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import static org.hamcrest.CoreMatchers.is; import static org.hamcrest.CoreMatchers.notNullValue; import static org.junit.Assert.assertThat; import static org.kie.dmn.core.util.DynamicTypeUtils.entry; import static org.kie.dmn.core.util.DynamicTypeUtils.mapOf; public class DMN13specificTest extends BaseVariantTest { public static final Logger LOG = LoggerFactory.getLogger(DMN13specificTest.class); public DMN13specificTest(final BaseVariantTest.VariantTestConf conf) { super(conf); } @Test public void testDMNv1_3_simple() { final DMNRuntime runtime = createRuntime("simple.dmn", this.getClass()); final DMNModel dmnModel = runtime.getModel("http://www.trisotech.com/definitions/_9d01a0c4-f529-4ad8-ad8e-ec5fb5d96ad4", "Chapter 11 Example"); assertThat(dmnModel, notNullValue()); assertThat(DMNRuntimeUtil.formatMessages(dmnModel.getMessages()), dmnModel.hasErrors(), is(false)); final DMNContext context = DMNFactory.newContext(); context.set("name", "John"); final DMNResult dmnResult = evaluateModel(runtime, dmnModel, context); LOG.debug("{}", dmnResult); assertThat(DMNRuntimeUtil.formatMessages(dmnResult.getMessages()), dmnResult.hasErrors(), is(false)); final DMNContext result = dmnResult.getContext(); assertThat(result.get("salutation"), is("Hello, John")); if (isTypeSafe()) { FEELPropertyAccessible outputSet = ((DMNContextFPAImpl)dmnResult.getContext()).getFpa(); Map<String, Object> allProperties = outputSet.allFEELProperties(); assertThat(allProperties.get("salutation"), is("Hello, John")); } } @Test public void testDMNv1_3_ch11() { testName = "testDMNv1_3_ch11"; final DMNRuntime runtime = createRuntimeWithAdditionalResources("Chapter 11 Example.dmn", this.getClass(), "Financial.dmn"); final DMNModel dmnModel = runtime.getModel("http://www.trisotech.com/definitions/_9d01a0c4-f529-4ad8-ad8e-ec5fb5d96ad4", "Chapter 11 Example"); assertThat(dmnModel, notNullValue()); assertThat(DMNRuntimeUtil.formatMessages(dmnModel.getMessages()), dmnModel.hasErrors(), is(false)); final DMNContext context = DMNFactory.newContext(); context.set("Applicant data", mapOf(entry("Age", new BigDecimal(51)), entry("MartitalStatus", "M"), // typo is present in DMNv1.3 entry("EmploymentStatus", "EMPLOYED"), entry("ExistingCustomer", false), entry("Monthly", mapOf(entry("Income", new BigDecimal(100_000)), entry("Repayments", new BigDecimal(2_500)), entry("Expenses", new BigDecimal(10_000)))))); context.set("Bureau data", mapOf(entry("Bankrupt", false), entry("CreditScore", new BigDecimal(600)))); context.set("Requested product", mapOf(entry("ProductType", "STANDARD LOAN"), entry("Rate", new BigDecimal(0.08)), entry("Term", new BigDecimal(36)), entry("Amount", new BigDecimal(100_000)))); context.set("Supporting documents", null); final DMNResult dmnResult = evaluateModel(runtime, dmnModel, context); LOG.debug("{}", dmnResult); assertThat(DMNRuntimeUtil.formatMessages(dmnResult.getMessages()), dmnResult.hasErrors(), is(false)); final DMNContext result = dmnResult.getContext(); assertThat(result.get("Strategy"), is("THROUGH")); assertThat(result.get("Routing"), is("ACCEPT")); if (isTypeSafe()) { FEELPropertyAccessible outputSet = ((DMNContextFPAImpl)dmnResult.getContext()).getFpa(); Map<String, Object> allProperties = outputSet.allFEELProperties(); assertThat(allProperties.get("Strategy"), is("THROUGH")); assertThat(allProperties.get("Routing"), is("ACCEPT")); } } @Test public void testDMNv1_3_ch11_asSpecInputDataValues() { testName = "testDMNv1_3_ch11_asSpecInputDataValues"; final DMNRuntime runtime = createRuntimeWithAdditionalResources("Chapter 11 Example.dmn", this.getClass(), "Financial.dmn"); final DMNModel dmnModel = runtime.getModel("http://www.trisotech.com/definitions/_9d01a0c4-f529-4ad8-ad8e-ec5fb5d96ad4", "Chapter 11 Example"); assertThat(dmnModel, notNullValue()); assertThat(DMNRuntimeUtil.formatMessages(dmnModel.getMessages()), dmnModel.hasErrors(), is(false)); final DMNContext context = DMNFactory.newContext(); context.set("Applicant data", mapOf(entry("Age", new BigDecimal(51)), entry("MartitalStatus", "M"), // typo is present in DMNv1.3 entry("EmploymentStatus", "EMPLOYED"), entry("ExistingCustomer", false), entry("Monthly", mapOf(entry("Income", new BigDecimal(10_000)), entry("Repayments", new BigDecimal(2_500)), entry("Expenses", new BigDecimal(3_000)))))); context.set("Bureau data", mapOf(entry("Bankrupt", false), entry("CreditScore", new BigDecimal(600)))); context.set("Requested product", mapOf(entry("ProductType", "STANDARD LOAN"), entry("Rate", new BigDecimal(0.08)), entry("Term", new BigDecimal(36)), entry("Amount", new BigDecimal(100_000)))); context.set("Supporting documents", null); final DMNResult dmnResult = evaluateModel(runtime, dmnModel, context); LOG.debug("{}", dmnResult); assertThat(DMNRuntimeUtil.formatMessages(dmnResult.getMessages()), dmnResult.hasErrors(), is(false)); final DMNContext result = dmnResult.getContext(); assertThat(result.get("Strategy"), is("THROUGH")); assertThat(result.get("Routing"), is("ACCEPT")); if (isTypeSafe()) { FEELPropertyAccessible outputSet = ((DMNContextFPAImpl)dmnResult.getContext()).getFpa(); Map<String, Object> allProperties = outputSet.allFEELProperties(); assertThat(allProperties.get("Strategy"), is("THROUGH")); assertThat(allProperties.get("Routing"), is("ACCEPT")); } } }
{ "redpajama_set_name": "RedPajamaGithub" }
7,764
Awkward but necessary: A's owner Lew Wolff asking for a five-year lease extension at the Coliseum. Necessary because the team's lease is up after next season. Awkward because the A's find themselves supplicants despite trying (with no success) to abandon Oakland for San Jose. The Mercury News' John Woolfolk writes about it, noting the parallel to 2006, the last time the A's asked for (and got) an extension, while vainly chasing plans for a new stadium in Fremont, remember? This time around, the Coliseum Authority is likely to press for a longer Oakland guarantee and/or more money. Should be a fun negotiation. Postscript: Wolff's letter intimates if the A's don't get an extension that pleases them, they could move to a "temporary home venue." Hard to envision where that might be.
{ "redpajama_set_name": "RedPajamaC4" }
4,110
<?php use MediaWiki\Logger\LoggerFactory; /** * Unit to authenticate log-in attempts to the current wiki. * * @ingroup API */ class ApiLogin extends ApiBase { public function __construct( ApiMain $main, $action ) { parent::__construct( $main, $action, 'lg' ); } /** * Executes the log-in attempt using the parameters passed. If * the log-in succeeds, it attaches a cookie to the session * and outputs the user id, username, and session token. If a * log-in fails, as the result of a bad password, a nonexistent * user, or any other reason, the host is cached with an expiry * and no log-in attempts will be accepted until that expiry * is reached. The expiry is $this->mLoginThrottle. */ public function execute() { // If we're in a mode that breaks the same-origin policy, no tokens can // be obtained if ( $this->lacksSameOriginSecurity() ) { $this->getResult()->addValue( null, 'login', array( 'result' => 'Aborted', 'reason' => 'Cannot log in when the same-origin policy is not applied', ) ); return; } $params = $this->extractRequestParams(); $result = array(); // Init session if necessary if ( session_id() == '' ) { wfSetupSession(); } $context = new DerivativeContext( $this->getContext() ); $context->setRequest( new DerivativeRequest( $this->getContext()->getRequest(), array( 'wpName' => $params['name'], 'wpPassword' => $params['password'], 'wpDomain' => $params['domain'], 'wpLoginToken' => $params['token'], 'wpRemember' => '' ) ) ); $loginForm = new LoginForm(); $loginForm->setContext( $context ); $authRes = $loginForm->authenticateUserData(); switch ( $authRes ) { case LoginForm::SUCCESS: $user = $context->getUser(); $this->getContext()->setUser( $user ); $user->setCookies( $this->getRequest(), null, true ); ApiQueryInfo::resetTokenCache(); // Run hooks. // @todo FIXME: Split back and frontend from this hook. // @todo FIXME: This hook should be placed in the backend $injected_html = ''; Hooks::run( 'UserLoginComplete', array( &$user, &$injected_html ) ); $result['result'] = 'Success'; $result['lguserid'] = intval( $user->getId() ); $result['lgusername'] = $user->getName(); $result['lgtoken'] = $user->getToken(); $result['cookieprefix'] = $this->getConfig()->get( 'CookiePrefix' ); $result['sessionid'] = session_id(); break; case LoginForm::NEED_TOKEN: $result['result'] = 'NeedToken'; $result['token'] = $loginForm->getLoginToken(); $result['cookieprefix'] = $this->getConfig()->get( 'CookiePrefix' ); $result['sessionid'] = session_id(); break; case LoginForm::WRONG_TOKEN: $result['result'] = 'WrongToken'; break; case LoginForm::NO_NAME: $result['result'] = 'NoName'; break; case LoginForm::ILLEGAL: $result['result'] = 'Illegal'; break; case LoginForm::WRONG_PLUGIN_PASS: $result['result'] = 'WrongPluginPass'; break; case LoginForm::NOT_EXISTS: $result['result'] = 'NotExists'; break; // bug 20223 - Treat a temporary password as wrong. Per SpecialUserLogin: // The e-mailed temporary password should not be used for actual logins. case LoginForm::RESET_PASS: case LoginForm::WRONG_PASS: $result['result'] = 'WrongPass'; break; case LoginForm::EMPTY_PASS: $result['result'] = 'EmptyPass'; break; case LoginForm::CREATE_BLOCKED: $result['result'] = 'CreateBlocked'; $result['details'] = 'Your IP address is blocked from account creation'; $block = $context->getUser()->getBlock(); if ( $block ) { $result = array_merge( $result, ApiQueryUserInfo::getBlockInfo( $block ) ); } break; case LoginForm::THROTTLED: $result['result'] = 'Throttled'; $throttle = $this->getConfig()->get( 'PasswordAttemptThrottle' ); $result['wait'] = intval( $throttle['seconds'] ); break; case LoginForm::USER_BLOCKED: $result['result'] = 'Blocked'; $block = User::newFromName( $params['name'] )->getBlock(); if ( $block ) { $result = array_merge( $result, ApiQueryUserInfo::getBlockInfo( $block ) ); } break; case LoginForm::ABORTED: $result['result'] = 'Aborted'; $result['reason'] = $loginForm->mAbortLoginErrorMsg; break; default: ApiBase::dieDebug( __METHOD__, "Unhandled case value: {$authRes}" ); } $this->getResult()->addValue( null, 'login', $result ); LoggerFactory::getInstance( 'authmanager' )->info( 'Login attempt', array( 'event' => 'login', 'successful' => $authRes === LoginForm::SUCCESS, 'status' => LoginForm::$statusCodes[$authRes], ) ); } public function mustBePosted() { return true; } public function isReadMode() { return false; } public function getAllowedParams() { return array( 'name' => null, 'password' => array( ApiBase::PARAM_TYPE => 'password', ), 'domain' => null, 'token' => null, ); } protected function getExamplesMessages() { return array( 'action=login&lgname=user&lgpassword=password' => 'apihelp-login-example-gettoken', 'action=login&lgname=user&lgpassword=password&lgtoken=123ABC' => 'apihelp-login-example-login', ); } public function getHelpUrls() { return 'https://www.mediawiki.org/wiki/API:Login'; } }
{ "redpajama_set_name": "RedPajamaGithub" }
4,279
One 'foreign national' killed in Alaska lodge blaze, 3 others survive: Media Responders assess the fire at the Park's Cannery near Uyak Bay on Alaska's Kodiak Island. PHOTO: US COAST GUARD Emergency medical personnel transfer patients from a rescue helicopter to an ambulance. PHOTO: US COAST GUARD Jun 5, 2016, 10:16 am SGT http://str.sg/43ss ANCHORAGE - One "foreign national" was killed in a blaze that swept through a lodge in Kodiak Island in the United States state of Alaska, according to state troopers that were interviewed by local media outlets. The state troopers said on Friday (June 3) that they arrived at the lodge at about 10.15pm last Thursday( June 2) and recovered a body from the debris, reported the Alaska Dispatch News (ADN). Three survivors were also rescued. "It is believed that the surviving victims and the deceased are all foreign nationals," the troopers told the ADN. The body of the victim will be sent for an autopsy in the state's largest city Anchorage, according to the ADN. One survivor was taken to Kodiak for medical treatment while two others were transported to Seattle, a troops spokesman told the ADN. The fire was first reported in the early hours of last Thursday, according to a spokesman for the US coast guard. Investigations are ongoing.
{ "redpajama_set_name": "RedPajamaCommonCrawl" }
5,331
'use strict'; // The module 'vscode' contains the VS Code extensibility API // Import the module and reference it with the alias vscode in your code below import * as vscode from 'vscode'; import { WordCounter } from './WordCounter'; import { WordCountController } from './WordCountController'; // this method is called when your extension is activated // your extension is activated the very first time the command is executed export function activate(context: vscode.ExtensionContext) { const configuration = vscode.workspace.getConfiguration("wordcount_cjk"); let counter = new WordCounter(configuration); let controller = new WordCountController(configuration, counter); let command1 = vscode.commands.registerCommand('extension.wordcount', () => { // This command is used to activate the extension when // edit non-standard type files. controller.update(/* force = */true); }); let command2 = vscode.commands.registerCommand('extension.wordcountActivate', () => { // This command is used to activate the extension when // edit non-standard type files. controller.activate(); }); let command3 = vscode.commands.registerCommand('extension.wordcountDeactivate', () => { // This command is used to deactivate the extension controller.deactivate(); }); context.subscriptions.push(command1); context.subscriptions.push(command2); context.subscriptions.push(command3); context.subscriptions.push(controller); } // this method is called when your extension is deactivated export function deactivate() { }
{ "redpajama_set_name": "RedPajamaGithub" }
1,315
"""Unit tests for the weights.ChooseDefaultWeightsLinear plugin.""" import unittest from datetime import datetime as dt import iris import numpy as np from iris.coords import AuxCoord from iris.tests import IrisTest from improver.blending.weights import ChooseDefaultWeightsLinear as LinearWeights from improver.synthetic_data.set_up_test_cubes import ( add_coordinate, set_up_variable_cube, ) class Test__init__(IrisTest): """Test the __init__ method.""" def test_basic(self): """Test values of y0val and ynval are set correctly""" plugin = LinearWeights(y0val=20.0, ynval=2.0) self.assertEqual(plugin.y0val, 20.0) self.assertEqual(plugin.ynval, 2.0) def test_fails_y0val_less_than_zero(self): """Test it raises a Value Error if y0val less than zero. """ msg = "y0val must be a float >= 0.0" with self.assertRaisesRegex(ValueError, msg): LinearWeights(y0val=-10.0, ynval=2.0) class Test_linear_weights(IrisTest): """Test the linear weights function. """ def test_basic(self): """Test that the function returns an array of weights""" result = LinearWeights(y0val=20.0, ynval=2.0).linear_weights(3) self.assertIsInstance(result, np.ndarray) def test_returns_correct_values_num_of_weights_one(self): """Test it returns the correct values, method is proportional""" result = LinearWeights(y0val=20.0, ynval=2.0).linear_weights(1) expected_result = np.array([1.0]) self.assertArrayAlmostEqual(result, expected_result) def test_returns_correct_values_y0val_ynval_set(self): """Test it returns the correct values when y0val and ynval set""" result = LinearWeights(y0val=10.0, ynval=5.0).linear_weights(6) expected_result = np.array( [0.22222222, 0.2, 0.17777778, 0.15555556, 0.13333333, 0.11111111] ) self.assertArrayAlmostEqual(result, expected_result) def test_returns_correct_values_y0val_is_0_ynval_set(self): """Test it returns the correct values when y0val=0 and ynval set""" result = LinearWeights(y0val=0.0, ynval=5.0).linear_weights(5) expected_result = np.array([0.0, 0.1, 0.2, 0.3, 0.4]) self.assertArrayAlmostEqual(result, expected_result) def test_fails_if_total_weights_zero(self): """Test it raises an error when y0val=0 and ynval=0""" msg = "Sum of weights must be > 0.0" with self.assertRaisesRegex(ValueError, msg): LinearWeights(y0val=0.0, ynval=0.0).linear_weights(5) class Test_process(IrisTest): """Test the Default Linear Weights plugin. """ def setUp(self): """Set up for testing process method""" cube = set_up_variable_cube( np.zeros((2, 2), dtype=np.float32), name="lwe_thickness_of_precipitation_amount", units="m", time=dt(2017, 1, 10, 5, 0), frt=dt(2017, 1, 10, 3, 0), ) self.cube = add_coordinate( cube, [dt(2017, 1, 10, 5, 0), dt(2017, 1, 10, 6, 0)], "time", is_datetime=True, ) self.coord_name = "time" def test_basic(self): """Test that the plugin returns a cube of weights. """ plugin = LinearWeights(y0val=20.0, ynval=2.0) result = plugin.process(self.cube, self.coord_name) self.assertIsInstance(result, iris.cube.Cube) def test_array_sum_equals_one(self): """Test that the resulting weights add up to one. """ plugin = LinearWeights(y0val=20.0, ynval=2.0) result = plugin.process(self.cube, self.coord_name) self.assertAlmostEqual(result.data.sum(), 1.0) def test_fails_input_not_a_cube(self): """Test it raises a Value Error if not supplied with a cube. """ plugin = LinearWeights(y0val=20.0, ynval=2.0) notacube = 0.0 msg = "The first argument must be an instance of " "iris.cube.Cube" with self.assertRaisesRegex(TypeError, msg): plugin.process(notacube, self.coord_name) def test_works_scalar_coord(self): """Test it works if scalar coordinate. """ self.cube.add_aux_coord(AuxCoord(1, long_name="scalar_coord", units="no_unit")) coord = self.cube.coord("scalar_coord") plugin = LinearWeights(y0val=20.0, ynval=2.0) result = plugin.process(self.cube, coord) self.assertArrayAlmostEqual(result.data, np.array([1.0])) def test_works_defaults_used(self): """Test it works if defaults used. """ plugin = LinearWeights(y0val=20.0, ynval=2.0) result = plugin.process(self.cube, self.coord_name) expected_result = np.array([0.90909091, 0.09090909]) self.assertArrayAlmostEqual(result.data, expected_result) def test_works_y0val_and_ynval_set(self): """Test it works if y0val and ynval set. """ plugin = LinearWeights(y0val=10.0, ynval=5.0) result = plugin.process(self.cube, self.coord_name) expected_result = np.array([0.66666667, 0.33333333]) self.assertArrayAlmostEqual(result.data, expected_result) def test_works_with_larger_num(self): """Test it works with larger num_of_vals. """ plugin = LinearWeights(y0val=10.0, ynval=5.0) cubenew = add_coordinate(self.cube, np.arange(6), "realization", dtype=np.int32) coord = cubenew.coord("realization") result = plugin.process(cubenew, coord) expected_result = np.array( [0.22222222, 0.2, 0.17777778, 0.15555556, 0.13333333, 0.11111111] ) self.assertArrayAlmostEqual(result.data, expected_result) if __name__ == "__main__": unittest.main()
{ "redpajama_set_name": "RedPajamaGithub" }
9,752
\section{Introduction} Complex plasmas consist of small solid microparticles immersed in a plasma environment, and are the subject of widespread interest across a rich variety of research fields ~\cite{fortovbook, chu94, thomas96, fortov04, shuklaRev, baumgartner09, bonitz10, hartmann10, hartmann14}. Once injected into the plasma, microparticles become negatively charged due to the greater thermal velocity of the electrons compared to the ions. The particles interact through a shielded Coulomb potential, and many different dust structures in a plasma have been realized in ground-based laboratories and under microgravity conditions on board the International Space Station (ISS). Examples of these structures include vertical strings ~\cite{melzer06, kong11}, Yukawa or Coulomb balls ~\cite{arp04, bonitz06}, 2D ~\cite{knapek07, nosenko09} and quasi-2D systems ~\cite{woon04, chan07} and 3D ~\cite{klumov10, khrapak11} Coulomb crystals. Among the various strongly-coupled systems formed by dust particles, multiple vertical strings were recently utilized as a system for diagnosing structural phase transitions by Hyde \textit{et al.} ~\cite {kong13}. Dusty plasma systems display interesting collective effects such as vortices ~\cite{vaulina03, schwabe14}, dust acoustic waves (DAW) ~\cite{schwabe07, menzel10}, and dust rotation ~\cite{yousefi14, nosenko, worner11, worner12, laut, konopka00, sato01, cheung04, hou05, huang11, carstensen09, kahlert12, hartmann13, schablinski14}. Rotational dust motion is generally classified into one of two categories, rigid-body rotation $\Omega(\rho) \simeq $ const, with $\rho$ the rotation radius~\cite{nosenko, worner11, worner12, laut, sato01, cheung03, cheung04, hou05, huang11, carstensen09, kahlert12, hartmann13}, and sheared differential rotation ~\cite{konopka00, schablinski14, klindworth00}. In the majority of cases presented in the literature to date, cluster rotation has been shown to be driven by externally controlled parameters triggered by rotating electric fields ~\cite{nosenko, worner11, worner12, laut}, axial magnetic fields ~\cite{konopka00, sato01, cheung03, cheung04, hou05, huang11}, or rotating electrodes ~\cite{carstensen09, kahlert12, hartmann13, schablinski14}. Cheung \textit{et al}. applied an axial magnetic field to induce dust cluster rigid-body rotation, proposing that the radial confinement electric field is modified by the magnetic field, which in turn changes the angular velocity of the dust cluster ~\cite{cheung03}. Klindworth \textit{et al}. found that structural transitions, together with intershell rotation of the cluster, can be excited by exerting a torque on the cluster using two opposing laser beams. They also found that the decoupling of the shells within these finite clusters can occur creating a transition from cluster to intershell rotation by altering the Debye shielding. In this case, the intershell rotation barrier of a sixfold cluster is about twice as large as the Coulomb case ~\cite{klindworth00}. Recently, two innovative techniques using rotating electrodes and rotating electric fields were employed to investigate dust cluster rotation. The first technique is based on the assumption that the effects of the Coriolis force $2m(\vec{v} \times \vec{\Omega})$ and the Lorentz force $Q(\vec{v} \times \vec{B})$ are equivalent, allowing the study of magnetic field effects on complex plasmas without the necessity of installing a high power magnet setup ~\cite{carstensen09, kahlert12, hartmann13, schablinski14}. This technique allows experiments to be implemented through adoption of a rotating electrode to set the background neutral gas into rotation, with the subsequent gas drag driving the dust cluster rotation ~\cite{schablinski14}. Another interesting technique for driving clusters into rotation is through the use of a rotating electric field (see Refs. ~\cite{nosenko, worner11, worner12, laut}). Rotation is sustained by combining the torque created by the ion-drag and the field generated by the rotating electric field ~\cite{worner11}. In the present paper, structures consisting of multiple vertical strings are used as probes to study the spontaneous rotation of clusters trapped in a glass box. Rotations of clusters having asymmetric configurations are observed to take place naturally. We propose that such spontaneous cluster rotation is caused by the torque due to the ion wake force exerted on the asymmetric cluster. This allows the ion flow to be investigated using the rotation of the cluster. \section{Experimental setup} The experiment described here was conducted in a modified gaseous electronics conference (GEC) radiofrequency (rf) discharge cell ~\cite{kong14, qiao14}. The lower electrode has a diameter of 8 cm and is capacitively coupled to a rf signal generator operated at a frequency of 13.56 MHz. The upper electrode consists of a ring having a diameter of 8 cm, which is grounded, as are the surrounding cell walls. The vertical separation between the upper and lower electrodes is 1.9 cm. A dust dispenser above the grounded ring serves to introduce dust particles into the plasma, with oscilloscopes used to monitor the rf voltage and self-bias generated at the lower rf electrode. All experiments were conducted in argon gas at pressures between 100 and 200 mTorr. \begin{figure}[tbp] \includegraphics [width=0.48\textwidth]{setup} \caption{Sketch of the experimental setup. The plasma discharge is operated between the grounded ring-shaped upper electrode and the lower rf electrode which is driven at 13.56 MHz.} \label{fig:ITObox} \end{figure} Melamine formaldehyde (MF) microparticles having a mass density of 1.514 g/cm$^3$ and a diameter of 8.89 $\mu$m (as supplied by the manufacturer) were used. Particles were illuminated employing either a vertical or horizontal sheet of laser light. A Sony XC-HR50 charge-coupled device (CCD) camera operated at a frame rate of 60 fps and a Photron Fastcam 1024 PCI high-speed camera operated at a frame rate of 250 or 500 fps, were used to record the trajectories of the dust particles. In all experiments, the dust particles were confined in an open-ended glass box with a height of 12.7 mm and a width of 10.5 mm placed on the powered lower electrode ~\cite{kong14}, as shown in Fig. \ref{fig:ITObox}. \begin{figure}[tbp] \begin{center} \includegraphics [width=0.48\textwidth]{symmetricStruc} \caption{Top (upper row) and corresponding side (lower row) views of symmetric dust structures formed inside a glass box placed on the lower electrode. The system parameters and number of particles for each configuration are (a) 2.04 W, 100 mTorr, $N = 4$, (b) 2.17 W, 150 mTorr, $N = 6$, (c) 2.56 W, 150 mTorr, $N = 8$, (d) 2.19 W, 150 mTorr, $N = 10$, and (e) 2.43 W, 150 mTorr, $N = 9$.} \label{fig:symmetricStruc} \end{center} \end{figure} \section{Results} Multiple string structures were observed to form inside the glass box for neutral gas pressures between 100 and 200 mTorr and rf powers between 1.37 and 5.92 W. Dust cluster symmetry was observed to determine spontaneous rotation, with this rotation directly related to dust particle configuration. Symmetric cluster configurations were observed to exhibit little or no rotation; however, when this symmetry was broken, spontaneous rotation of the cluster was observed. Cluster symmetry was determined primarily by the number of particles and system confinement. In this case, symmetric structures were formed using a glass box of cubical geometry, which provides an isotropically harmonic trap potential in the central region of the box ~\cite{nosenko, worner11, worner12, laut}. Fig. \ref{fig:symmetricStruc} (a)-(e) shows a series of representative symmetric structures formed in this manner with (a)-(d) showing symmetric multiple-string structures consisting of dust particles arranged as two to five, two-particle strings. A three, three-particle chain structure comprised of nine particles is presented in Fig. \ref{fig:symmetricStruc} (e). No appreciable rotation for any of the clusters shown in Fig. \ref{fig:symmetricStruc} was observed. \begin{figure*}[tbp] \begin{center} \includegraphics [width=0.90\textwidth]{movie4} \caption{Sequence of images illustrating the rotation of an asymmetric structure with $N = 5$ particles. (a)-(g) correspond to the side view of this system with $\Delta t = 0.3$ s between frames. The top view of the cluster is shown in (h). System parameters are 1.76 W, 150 mTorr.} \label{fig:asymmetricStruc} \end{center} \end{figure*} \begin{figure}[tbp] \begin{center} \subfigure{ \includegraphics [width=0.16\textwidth]{chirality1} } \hspace{29.8pt} \subfigure{ \includegraphics [width=0.16\textwidth]{chirality2} } \subfigure{ \includegraphics [width=0.22\textwidth]{295mVchiralitySUB-eps-converted-to.pdf} } \subfigure{ \includegraphics [width=0.22\textwidth]{301mVchiralitySUB-eps-converted-to.pdf} } \caption{Chirality of structures. (a) Side view of the 5-particle cluster shown in Fig. \ref{fig:asymmetricStruc} (a), and a cluster which is its mirror image (b). System parameters for (b) are rf power 1.83 W, pressure 150 mTorr. Reconstructions of these structures are shown in (c) and (d) where the blue dots represent the dust particles, the solid red lines indicate particles which are nearly vertically aligned, and the dashed line shows the projection of the unpaired particle on the $xy$-plane.} \label{fig:helix} \end{center} \end{figure} \begin{figure}[tbp] \centering \subfigure{ \includegraphics[width=0.21\textwidth]{295mVtrajec2-eps-converted-to.pdf} } \hspace{0.6pt} \subfigure{ \includegraphics[width=0.21\textwidth]{356mVtrajec2-eps-converted-to.pdf} } \subfigure{ \includegraphics[width=0.215\textwidth]{compareSpeed1-eps-converted-to.pdf} } \subfigure{ \includegraphics[width=0.215\textwidth]{angleVStime356mV20160609su-eps-converted-to.pdf} } \caption{Particle positions recorded over 20 seconds for (a) the asymmetric $N = 5$ cluster shown in Fig. 3 and (b) the symmetric $N = 8$ cluster shown in Fig. 2 (c). The points shown in (a) indicate the positions of the two different particles within the cluster. The lines indicate the best-fit ellipses to the circular motion. The rotation angle of a representative particle within each of the clusters, with respect to a fixed axis, is shown in (c) and (d) as a function of time. In (c), the rotation angle is shown for rf powers of 1.76 W (red circles), 1.83 W (green squares) and 1.89 W (blue diamonds).} \label{fig:trajec} \end{figure} \begin{table*}[tbp] \setlength{\tabcolsep}{1.16em} \caption{Experimentally measured and theoretically calculated parameters for six asymmetric and two symmetric clusters. Calculated values for $M$, $q_w$, and $z_w$ are shown for $Q_d = 13000$e with decharging of downstream grains assumed to be $0.8Q_d$.} \label{tab:torqueTable1} \begin{tabular}{lcccccccccc} \\ \hline \hline N &Power &P &Bias &$\omega$ &$h_{COM}$ &$\tau_{d}$ &$\lambda_{De}$ &$M$ &$q_w$ &$z_w$ \\ &(W) &(mTorr) &(V) &(s$^{-1}$) &(mm) &($\times 10^{-12}$ N$\cdot \mu$m) &($\mu$m) & &(e) &$(\lambda_{De})$ \\ \hline 5 &1.76 &150 &-24.5 &-3.4 &7.57 &-5.06 &336 &0.97 &2132 &1.20 \\ 5 &1.83 &150 &-25.5 &1.9 &7.48 &3.20 &330 &1.04 &2057 &1.30 \\ 5 &1.89 &150 &-36.2 &1.1 &7.37 &1.79 &324 &1.11 &1973 &1.39 \\ \\ 5 &1.92 &150 &-25.0 &1.5 &7.58 &2.10 &322 &1.10 &1982 &1.38 \\ 5 &1.92 &140 &-26.2 &-2.3 &8.04 &-3.32 &333 &1.03 &2069 &1.28 \\ 5 &1.92 &130 &-27.3 &-3.7 &8.44 &-4.79 &345 &0.99 &2115 &1.23 \\ \\ 6 &2.17 &150 &-35.3 &-0.029 &6.78 &-0.0751 &300 &1.12 &1964 &1.40 \\ 8 &2.56 &150 &-41.2 &0.055 &6.61 &0.211 &269 &2.34 &1194 &2.80 \\ \hline \hline \end{tabular} \end{table*} \begin{figure}[tbp] \subfigure{ \includegraphics[width=0.354\textwidth]{machcoptic-eps-converted-to.pdf} } \subfigure{ \includegraphics[width=0.358\textwidth]{wakePotentialVsM-eps-converted-to.pdf} } \subfigure{ \includegraphics[width=0.358\textwidth]{wakePosiVsM-eps-converted-to.pdf} } \caption{(a) Normalized wake potential profile along the $x = y = 0$ axis for distinct ion drift velocities. Variation of the maximum wake potential is shown in (b) and its position with drift speed is given in (c). The lines in (b) and (c) provide a high order polynomial fit to the data.} \label{fig:wakeAnalysis} \end{figure} Once cluster symmetry was broken, spontaneous rotation was observed. An asymmetric $N = 5$ cluster is shown in Fig. \ref{fig:asymmetricStruc}. (A movie showing the complete rotation of this cluster is attached as Supplemental Material.) The direction of rotation of such asymmetric clusters can be either clockwise or counterclockwise, depending on cluster chirality. (See Fig. \ref{fig:helix} (a) and (b), for two five-particle clusters, along with their reconstructed 3D models as shown in Figs. \ref{fig:helix} (c) and (d).) The clusters shown in Fig. \ref{fig:helix} (a) and (b) rotated counterclockwise and clockwise, respectively, once formed. (Two movies are attached in the Supplemental Material to demonstrate this chirality-related rotation.) \begin{figure}[tbp] \centering \subfigure{ \includegraphics[width=0.37\textwidth]{copticOmegaVsMforPower-eps-converted-to.pdf} } \subfigure{ \includegraphics[width=0.37\textwidth]{copticOmegaVsMforPressure-eps-converted-to.pdf} } \subfigure{ \includegraphics[width=0.37\textwidth]{copticOmegaVsMforSymmetric-eps-converted-to.pdf} } \caption{Calculated rotation speeds $\Omega$ of asymmetric $N = 5$ clusters as a function of the ion drift velocity for a fixed pressure of 150 mTorr (a) and a fixed power of 1.92 W (b). Variation of $\Omega$ with drift speed for two symmetric structures (c) at a pressure of 150 mTorr. Here $Q_d = 13000$e and the downstream grains are assumed to have a charge $0.8Q_d$. Symbols indicate the drift velocity required to match the rotation speed observed experimentally.} \label{fig:omegaAnalysis} \end{figure} \begin{table}[tbp] \setlength{\tabcolsep}{1.15em} \caption{Ion drift speed determined using varying values of $Q_d$ and the decharging factor of downstream grains under specific rf powers at 150 mTorr.} \label{tab:machTable} \begin{tabular}{l c c c c} \hline\hline \multicolumn 1 {c}{Power} & \multicolumn 1 {c}{Decharging} & \multicolumn 3 {c}{$Q_d (e)$} \\ \cline{3-5} (W) &$(Q_d)$ &12000 &13000 &14000 \\ \hline 1.76 &0.7 &0.92 &0.96 &0.97 \\ 1.76 &0.8 &0.95 &0.97 &0.98 \\ 1.76 &0.9 &0.96 &0.97 &0.98 \\ 1.83 &0.7 &1.01 &1.03 &1.04 \\ 1.83 &0.8 &1.02 &1.04 &1.05 \\ 1.83 &0.9 &1.03 &1.05 &1.06 \\ 1.89 &0.7 &1.08 &1.10 &1.11 \\ 1.89 &0.8 &1.09 &1.11 &1.12 \\ 1.89 &0.9 &1.10 &1.12 &1.13 \\ \hline\hline \end{tabular} \end{table} Fig. \ref{fig:trajec} (a) and (b) illustrate representative particle trajectories in the horizontal plane (i.e., imaged by the top view camera) for the asymmetric cluster shown in Fig. \ref{fig:asymmetricStruc} and symmetric structure shown in Fig. \ref{fig:symmetricStruc} (c), respectively. Interestingly, the center of rotation for the asymmetric cluster is not located at the projection of the cluster's COM in the horizontal plane, which is given by $\vec{r}_{com} = \sum \vec{r}_i/N$, where $\vec{r}_i$ is the position of each dust particle with respect to the center of the box and height above the lower electrode and $N$ is the total number of particles comprising the cluster. Fig. \ref{fig:trajec} (c) and (d) show the rotational orientation of the clusters over time. As shown, the asymmetric cluster exhibits a uniform angular rotation speed, which increases as the power is decreased (Fig. 5(c)) while Fig. \ref{fig:trajec} (d) shows only a small change in orientation of the symmetric cluster, with a maximum rotation speed of 0.055 s$^{-1}$. The angular speed $\omega$ and the height of the COM $h_{COM}$ of the clusters are summarized in Table \ref{tab:torqueTable1} for various experimental conditions. For fixed rf power, the angular speed of the cluster decreases with increasing pressure as shown. \section{Rotational mechanisms and discussion} We propose that the spontaneous rotation observed for the small clusters described in this experiment is induced by the torque due to the ion wake field force when applied to the cluster once cluster symmetry is broken. At equilibrium, the net torque $\vec{\tau}_{net}$ that causes the cluster's rotation is balanced by the torque $\vec{\tau}_{d}$ due to the neutral drag force created by the cluster's uniform rotation, \begin{equation} \vec{\tau}_{net} = \vec{\tau}_{d}. \end{equation} The neutral drag torque $\vec{\tau}_{d}$ is given as \begin{equation} \vec{\tau}_{d} = \sum_{i=1}^{N'}\vec{r_j} \times \vec{F}_{dj}, \end{equation} where $\vec{F}_{dj} = -m_d\beta\vec{v}_j$ is the neutral drag force applied on the $j$th particle, $\vec{r}_j$ is the position of the particle measured from the axis of rotation, $\vec{v}_j$ is the tangential velocity of the $j$th dust particle and $\beta$ is the Epstein drag coefficient defined as \begin{equation} \beta = \delta\frac{8}{\pi}\frac{P}{a\rho v_{th,n}}, \end{equation} where $\delta$ is a coefficient depicting the reflection of the neutral gas atoms from the surface of the dust, ($\delta = 1.26$ $\pm$ $0.13$ for MF particles in argon gas ~\cite{binliu}), $P$ is the gas pressure, $a$ the particle radius, $\rho$ is the particle's mass density and $v_{th,n} = \sqrt{8k_BT_n/\pi m_n}$ is the mean thermal velocity of the neutral gas. The temperature of the neutral gas is taken to be $T_n = 300$ K and the mass of the argon gas $m_n = 6.64 \times 10^{-26}$ kg. The neutral drag torque $\vec{\tau}_{d}$ is calculated and summarized in Table \ref{tab:torqueTable1} for four different clusters under different experimental conditions. The torque driving the rotation can be written as \begin{equation} \vec{\tau}_{net} = \sum_{j=1}^{N} \vec{r_j} \times \vec{F}_j, \end{equation} where $\vec{F}_j$ is the total force exerted on the $j$th particle excluding the neutral drag force, and is given by \begin{equation} \vec{F}_{j} = \vec{F}_{elecj} + \vec{F}_{ionj} + \vec{F}_{interj} \end{equation} with $\vec{F}_{elecj}$ being the electric field force, $\vec{F}_{ionj}$ the ion wake field force, and $\vec{F}_{interj}$ the interparticle force from all other particles exerted on the $j$th particle. Inasmuch as $\vec{F}_{elecj} = \vec{\nabla} U_j$ is a conservative force, zero work is done by $\vec{F}_{elecj}$ moving a dust particle through a complete rotational trajectory, i.e. $\oint \vec{F}_{elecj} \cdot d\vec{r}_j = 0$. As such, $\vec{F}_{elecj}$ will not produce steady-state rotation for either symmetric or asymmetric structures since it cannot feed energy to the system ~\cite{flanagan09}. $\vec{F}_{interj}$ is an internal force between dust particles and can not contribute to rotation of the structures. This leaves the ion wake field force $\vec{F}_{ionj}$ as one possible contributor to the observed rotation. Thus, Eq. (4) can now be rewritten as \begin{equation} \vec{\tau}_{net} = \sum_{j=1}^{N}\vec{r_j} \times \vec{F}_{ionj}. \end{equation} In order to determine $\vec{F}_{ionj}$, a point charge model was employed to model the ion wake field ~\cite{qiao13, qiao14, vladimirov95, goree95, ishihara97, lampe00, ivlev03, kompaneets07, zhdanov09}. Assuming the ion wakefield acts as a positive point charge located beneath each dust particle, the ion wake field force experienced by the $j$th dust particle $\vec{F}_{ionj}$ is given by \begin{equation} \vec{F}_{ionj} = \sum_{k \neq j}^{N}\frac{Q_dq_w(\vec{R}_k - \vec{r}_j)}{4\pi\varepsilon_0|\vec{R}_k - \vec{r}_j|^3}, \end{equation} where $Q_d$, $q_w$ are the dust charge and wakefield point charge, $\vec{R}_k = \vec{r}_k - z_w\hat{z}$ is the location of the point charge located a distance $z_w$ beneath the $k$th particle, and $\varepsilon_0$ is the vacuum permittivity. Since the cluster's rotation axis is in the vertical direction, only the horizontal component of $\vec{F}_{ionj}$ contributes to the driving torque for the rotation. The location ($z_w$) and magnitude ($q_w$) of the wakefield point charge depends on the experimental conditions, since the power and pressure settings determine the particle charge and ion drift speed. Changes to the rf power also alter the electron and ion density, as well as change the electron temperature, which determines the bias on the lower electrode (establishing the ion drift velocity) and the dust surface charge. The electron Debye length under representative experimental conditions was estimated based on the results presented in Ref. ~\cite{kong14, nosenko14} (see Table \ref{tab:torqueTable1}). The charge on a dust grain within the sheath of a rf discharge is generally on the order of 1000e per $\mu$m diameter. Using the result from previous experiments under similar experimental conditions the dust charge was assumed to be $\sim$12700e ~\cite{kong14}. However, we analyzed the motion assuming $Q_d = 12000$e, 13000e, and 14000e to determine the extent to which the dust charge influences the rotation rate. Additionally, theoretical and experimental results have shown that downstream dust grains are decharged relative to the upstream grains ~\cite{block15}. Accordingly, a charge of 0.7, 0.8, and 0.9$Q_d$ was assumed for the lower grains in a cluster. (See Table \ref{tab:machTable}.) Estimates for the point charge and its location downstream from a particle were obtained employing the COPTIC (Cartesian mesh, oblique boundary, particles and thermals in cell) code developed by Hutchinson ~\cite{hutch11pop, hutch11prl, hutch12pre, hutch13pop, hutch13ppcf}. In this simulation, grains are represented as point charges immersed in a collisionless plasma using uniform external drifting-Maxwellian ion distributions with $T_i/T_e = 0.01$. Calculations are performed on a $44 \times 44 \times 96$ cell grid with nonuniform mesh spacing over a cubical domain of $ 10 \times 10 \times 25$ Debye lengths, where the ions are flowing along the $\hat{z}$-direction with a drift velocity $v_d$ expressed as a Mach number $M = v_d/c_s$ where $c_s = \sqrt{T_e/m_i}$ is the cold-ion sound speed. The code is run with the point charge representing a dust particle located at position $(0,0,0)$. The analytical part of this point charge extends to radius $r_p = 0.1 \lambda_{De}$. At this distance, the floating potential $\phi_p = -0.25T_e/e$ with $T_e = 2.585$ eV. Distinct drift velocities ranging from 0.1 to 3.3 were used in the COPTIC program to determine the maximum value of the wake potential and its location. Fig. \ref{fig:wakeAnalysis} (a) shows the wake potential profile along the axial direction normalized to the dust grain potential as a function of the ion drift velocity $M$. As can be seen, the maximum wake potential $\phi_{max}$ achieves its peak value for $M = 0.8$ (Fig. \ref{fig:wakeAnalysis} (b)), with its position $z_w$ shifting further away from the dust grain for increasing drift velocity (see Fig. \ref{fig:wakeAnalysis} (c)). The magnitude of the wakefield point charge $q_w$ can be calculated as $q_w \approx Q_d\phi_{max}/|\phi_p|$, where $\phi_p$ is the value of the dust surface potential. The theoretical rotation speed $\Omega$ can now be calculated based on $q_w$ and $z_w$ where using the COPTIC model to determine the ion flow velocity which best matches the experimental results. Assuming $\lambda_{De}$ for the experimental conditions shown in Table \ref{tab:torqueTable1}, the magnitude and location of the wake point charge over the range of ion drift velocities were fit employing a higher order polynomial, and then used to calculate the torque on each of the clusters listed in Table \ref{tab:torqueTable1}. This torque was then equated to the neutral drag torque (Eq. 2) to determine the values of $q_w$ and $z_w$ needed to balance the torques, allowing an estimate of the ion drift speed to be obtained. As shown in Table \ref{tab:machTable}, the ion drift speed found using all possible values of $Q_d$ varies by less than $1.8\%$. The results of these calculations assuming an upstream dust charge $Q_d = 13000$e and all estimates of decharging for the downstream particle are shown in Fig. \ref{fig:omegaAnalysis} and Table \ref{tab:torqueTable1}. As shown in Fig. \ref{fig:omegaAnalysis}, there are always two values of $M$ which produce a rotational speed matching the experimentally measured value, one for $M < 0.7$ and one for $M > 0.7$. As observed in this experiment, the levitation height of the cluster decreases as the power is increased, as does the rotation rate. As the ion drift velocity $M$ increases closer to the lower electrode ~\cite{douglass11} the trend for decreasing $\Omega$ with increasing power (and thus increasing $M$) points to ion drift velocities $> 0.7$, as shown in Fig. \ref{fig:omegaAnalysis} (a). At fixed power, reducing the pressure causes a cluster's rotation speed to increase while the height of its COM increases. Thus, the Mach number should decrease with decreasing pressure, as is seen in Fig. \ref{fig:omegaAnalysis} (b). Finally, as shown in Fig. \ref{fig:omegaAnalysis} (c), the rotation rates for symmetric clusters are very small over a wide range of ion drift velocities. Calculated ion drift speeds are consistent with the expected increase in these values, given the power range explored in the experiment. According to the trends shown in Fig. \ref{fig:omegaAnalysis} (a) and (b), as the power and pressure are increased further, the rotation speeds of the clusters should be reduced to almost negligible amounts. However, this was not observed experimentally since when the power or pressure exceeded certain critical values, the structure of the cluster changed. Thus asymmetric structures were always observed to have rotation rates on the order of 1-10 rad/s. \vspace{7pt} \section{Conclusions} Clusters of a small number of dust particles were produced within a glass box placed on the lower electrode of a GEC rf cell. Self-excited rotation was observed for asymmetric structures with a uniform rotation speed, whereas no appreciable rotation was produced for symmetric structures. The asymmetric clusters were found to rotate about a vertical axis not passing through the center of mass. It was proposed that the spontaneous rotation for the small asymmetric dust clusters observed is probably induced by the net torque applied on the cluster due to the ion wake force. It was shown that symmetric clusters experience a very small net torque, and do not rotate. The rotation direction of the asymmetric cluster was determined by the conformational chirality of the specific structure, causing the cluster to spin either clockwise or counterclockwise. The torque induced by the ion wake force was calculated employing the ion wakefield point charge model, where the magnitude and location of the wakefield point charge was determined using the COPTIC code. Balancing the opposing torques induced by gas drag and the ion wake field allows the ion flow to be estimated within the glass box, which was found to be $\sim$1.0 $M$ for rf power $1.7 < P < 2.0$ W. This result is consistent with the values generally assumed for these experimental conditions ~\cite{hutch11prl}. These results are in rough agreement wiht Nosenko $et$ $al.$ ~\cite{nosenko12} who also found rotating particle pairs which they ascribed to the interaction with the ion wake field. Using the theory of Lampe $et$ $al.$ ~\cite{lampe12}, they estimated the Mach number of the ion flow to be 2.26 in the plasma sheath of an rf discharge at 157 mTorr and 5 W. Higher Mach numbers were also suggested by the results of this experiment in analyzing the small rotations observed for symmetric clusters formed at higher rf power. \section*{Acknowledgment} Support from NSF/DOE Grant No. 1414523 and NSF/NASA Grant No. 1740203 is gratefully acknowledged. \section{Introduction} Complex plasmas consist of small solid microparticles immersed in a plasma environment, and are the subject of widespread interest across a rich variety of research fields ~\cite{fortovbook, chu94, thomas96, fortov04, shuklaRev, baumgartner09, bonitz10, hartmann10, hartmann14}. Once injected into the plasma, microparticles become negatively charged due to the greater thermal velocity of the electrons compared to the ions. The particles interact through a shielded Coulomb potential, and many different dust structures in a plasma have been realized in ground-based laboratories and under microgravity conditions on board the International Space Station (ISS). Examples of these structures include vertical strings ~\cite{melzer06, kong11}, Yukawa or Coulomb balls ~\cite{arp04, bonitz06}, 2D ~\cite{knapek07, nosenko09} and quasi-2D systems ~\cite{woon04, chan07} and 3D ~\cite{klumov10, khrapak11} Coulomb crystals. Among the various strongly-coupled systems formed by dust particles, multiple vertical strings were recently utilized as a system for diagnosing structural phase transitions by Hyde \textit{et al.} ~\cite {kong13}. Dusty plasma systems display interesting collective effects such as vortices ~\cite{vaulina03, schwabe14}, dust acoustic waves (DAW) ~\cite{schwabe07, menzel10}, and dust rotation ~\cite{yousefi14, nosenko, worner11, worner12, laut, konopka00, sato01, cheung04, hou05, huang11, carstensen09, kahlert12, hartmann13, schablinski14}. Rotational dust motion is generally classified into one of two categories, rigid-body rotation $\Omega(\rho) \simeq $ const, with $\rho$ the rotation radius~\cite{nosenko, worner11, worner12, laut, sato01, cheung03, cheung04, hou05, huang11, carstensen09, kahlert12, hartmann13}, and sheared differential rotation ~\cite{konopka00, schablinski14, klindworth00}. In the majority of cases presented in the literature to date, cluster rotation has been shown to be driven by externally controlled parameters triggered by rotating electric fields ~\cite{nosenko, worner11, worner12, laut}, axial magnetic fields ~\cite{konopka00, sato01, cheung03, cheung04, hou05, huang11}, or rotating electrodes ~\cite{carstensen09, kahlert12, hartmann13, schablinski14}. Cheung \textit{et al}. applied an axial magnetic field to induce dust cluster rigid-body rotation, proposing that the radial confinement electric field is modified by the magnetic field, which in turn changes the angular velocity of the dust cluster ~\cite{cheung03}. Klindworth \textit{et al}. found that structural transitions, together with intershell rotation of the cluster, can be excited by exerting a torque on the cluster using two opposing laser beams. They also found that the decoupling of the shells within these finite clusters can occur creating a transition from cluster to intershell rotation by altering the Debye shielding. In this case, the intershell rotation barrier of a sixfold cluster is about twice as large as the Coulomb case ~\cite{klindworth00}. Recently, two innovative techniques using rotating electrodes and rotating electric fields were employed to investigate dust cluster rotation. The first technique is based on the assumption that the effects of the Coriolis force $2m(\vec{v} \times \vec{\Omega})$ and the Lorentz force $Q(\vec{v} \times \vec{B})$ are equivalent, allowing the study of magnetic field effects on complex plasmas without the necessity of installing a high power magnet setup ~\cite{carstensen09, kahlert12, hartmann13, schablinski14}. This technique allows experiments to be implemented through adoption of a rotating electrode to set the background neutral gas into rotation, with the subsequent gas drag driving the dust cluster rotation ~\cite{schablinski14}. Another interesting technique for driving clusters into rotation is through the use of a rotating electric field (see Refs. ~\cite{nosenko, worner11, worner12, laut}). Rotation is sustained by combining the torque created by the ion-drag and the field generated by the rotating electric field ~\cite{worner11}. In the present paper, structures consisting of multiple vertical strings are used as probes to study the spontaneous rotation of clusters trapped in a glass box. Rotations of clusters having asymmetric configurations are observed to take place naturally. We propose that such spontaneous cluster rotation is caused by the torque due to the ion wake force exerted on the asymmetric cluster. This allows the ion flow to be investigated using the rotation of the cluster. \section{Experimental setup} The experiment described here was conducted in a modified gaseous electronics conference (GEC) radiofrequency (rf) discharge cell ~\cite{kong14, qiao14}. The lower electrode has a diameter of 8 cm and is capacitively coupled to a rf signal generator operated at a frequency of 13.56 MHz. The upper electrode consists of a ring having a diameter of 8 cm, which is grounded, as are the surrounding cell walls. The vertical separation between the upper and lower electrodes is 1.9 cm. A dust dispenser above the grounded ring serves to introduce dust particles into the plasma, with oscilloscopes used to monitor the rf voltage and self-bias generated at the lower rf electrode. All experiments were conducted in argon gas at pressures between 100 and 200 mTorr. \begin{figure}[tbp] \includegraphics [width=0.48\textwidth]{setup} \caption{Sketch of the experimental setup. The plasma discharge is operated between the grounded ring-shaped upper electrode and the lower rf electrode which is driven at 13.56 MHz.} \label{fig:ITObox} \end{figure} Melamine formaldehyde (MF) microparticles having a mass density of 1.514 g/cm$^3$ and a diameter of 8.89 $\mu$m (as supplied by the manufacturer) were used. Particles were illuminated employing either a vertical or horizontal sheet of laser light. A Sony XC-HR50 charge-coupled device (CCD) camera operated at a frame rate of 60 fps and a Photron Fastcam 1024 PCI high-speed camera operated at a frame rate of 250 or 500 fps, were used to record the trajectories of the dust particles. In all experiments, the dust particles were confined in an open-ended glass box with a height of 12.7 mm and a width of 10.5 mm placed on the powered lower electrode ~\cite{kong14}, as shown in Fig. \ref{fig:ITObox}. \begin{figure}[tbp] \begin{center} \includegraphics [width=0.48\textwidth]{symmetricStruc} \caption{Top (upper row) and corresponding side (lower row) views of symmetric dust structures formed inside a glass box placed on the lower electrode. The system parameters and number of particles for each configuration are (a) 2.04 W, 100 mTorr, $N = 4$, (b) 2.17 W, 150 mTorr, $N = 6$, (c) 2.56 W, 150 mTorr, $N = 8$, (d) 2.19 W, 150 mTorr, $N = 10$, and (e) 2.43 W, 150 mTorr, $N = 9$.} \label{fig:symmetricStruc} \end{center} \end{figure} \section{Results} Multiple string structures were observed to form inside the glass box for neutral gas pressures between 100 and 200 mTorr and rf powers between 1.37 and 5.92 W. Dust cluster symmetry was observed to determine spontaneous rotation, with this rotation directly related to dust particle configuration. Symmetric cluster configurations were observed to exhibit little or no rotation; however, when this symmetry was broken, spontaneous rotation of the cluster was observed. Cluster symmetry was determined primarily by the number of particles and system confinement. In this case, symmetric structures were formed using a glass box of cubical geometry, which provides an isotropically harmonic trap potential in the central region of the box ~\cite{nosenko, worner11, worner12, laut}. Fig. \ref{fig:symmetricStruc} (a)-(e) shows a series of representative symmetric structures formed in this manner with (a)-(d) showing symmetric multiple-string structures consisting of dust particles arranged as two to five, two-particle strings. A three, three-particle chain structure comprised of nine particles is presented in Fig. \ref{fig:symmetricStruc} (e). No appreciable rotation for any of the clusters shown in Fig. \ref{fig:symmetricStruc} was observed. \begin{figure*}[tbp] \begin{center} \includegraphics [width=0.90\textwidth]{movie4} \caption{Sequence of images illustrating the rotation of an asymmetric structure with $N = 5$ particles. (a)-(g) correspond to the side view of this system with $\Delta t = 0.3$ s between frames. The top view of the cluster is shown in (h). System parameters are 1.76 W, 150 mTorr.} \label{fig:asymmetricStruc} \end{center} \end{figure*} \begin{figure}[tbp] \begin{center} \subfigure{ \includegraphics [width=0.16\textwidth]{chirality1} } \hspace{29.8pt} \subfigure{ \includegraphics [width=0.16\textwidth]{chirality2} } \subfigure{ \includegraphics [width=0.22\textwidth]{295mVchiralitySUB-eps-converted-to.pdf} } \subfigure{ \includegraphics [width=0.22\textwidth]{301mVchiralitySUB-eps-converted-to.pdf} } \caption{Chirality of structures. (a) Side view of the 5-particle cluster shown in Fig. \ref{fig:asymmetricStruc} (a), and a cluster which is its mirror image (b). System parameters for (b) are rf power 1.83 W, pressure 150 mTorr. Reconstructions of these structures are shown in (c) and (d) where the blue dots represent the dust particles, the solid red lines indicate particles which are nearly vertically aligned, and the dashed line shows the projection of the unpaired particle on the $xy$-plane.} \label{fig:helix} \end{center} \end{figure} \begin{figure}[tbp] \centering \subfigure{ \includegraphics[width=0.21\textwidth]{295mVtrajec2-eps-converted-to.pdf} } \hspace{0.6pt} \subfigure{ \includegraphics[width=0.21\textwidth]{356mVtrajec2-eps-converted-to.pdf} } \subfigure{ \includegraphics[width=0.215\textwidth]{compareSpeed1-eps-converted-to.pdf} } \subfigure{ \includegraphics[width=0.215\textwidth]{angleVStime356mV20160609su-eps-converted-to.pdf} } \caption{Particle positions recorded over 20 seconds for (a) the asymmetric $N = 5$ cluster shown in Fig. 3 and (b) the symmetric $N = 8$ cluster shown in Fig. 2 (c). The points shown in (a) indicate the positions of the two different particles within the cluster. The lines indicate the best-fit ellipses to the circular motion. The rotation angle of a representative particle within each of the clusters, with respect to a fixed axis, is shown in (c) and (d) as a function of time. In (c), the rotation angle is shown for rf powers of 1.76 W (red circles), 1.83 W (green squares) and 1.89 W (blue diamonds).} \label{fig:trajec} \end{figure} \begin{table*}[tbp] \setlength{\tabcolsep}{1.16em} \caption{Experimentally measured and theoretically calculated parameters for six asymmetric and two symmetric clusters. Calculated values for $M$, $q_w$, and $z_w$ are shown for $Q_d = 13000$e with decharging of downstream grains assumed to be $0.8Q_d$.} \label{tab:torqueTable1} \begin{tabular}{lcccccccccc} \\ \hline \hline N &Power &P &Bias &$\omega$ &$h_{COM}$ &$\tau_{d}$ &$\lambda_{De}$ &$M$ &$q_w$ &$z_w$ \\ &(W) &(mTorr) &(V) &(s$^{-1}$) &(mm) &($\times 10^{-12}$ N$\cdot \mu$m) &($\mu$m) & &(e) &$(\lambda_{De})$ \\ \hline 5 &1.76 &150 &-24.5 &-3.4 &7.57 &-5.06 &336 &0.97 &2132 &1.20 \\ 5 &1.83 &150 &-25.5 &1.9 &7.48 &3.20 &330 &1.04 &2057 &1.30 \\ 5 &1.89 &150 &-36.2 &1.1 &7.37 &1.79 &324 &1.11 &1973 &1.39 \\ \\ 5 &1.92 &150 &-25.0 &1.5 &7.58 &2.10 &322 &1.10 &1982 &1.38 \\ 5 &1.92 &140 &-26.2 &-2.3 &8.04 &-3.32 &333 &1.03 &2069 &1.28 \\ 5 &1.92 &130 &-27.3 &-3.7 &8.44 &-4.79 &345 &0.99 &2115 &1.23 \\ \\ 6 &2.17 &150 &-35.3 &-0.029 &6.78 &-0.0751 &300 &1.12 &1964 &1.40 \\ 8 &2.56 &150 &-41.2 &0.055 &6.61 &0.211 &269 &2.34 &1194 &2.80 \\ \hline \hline \end{tabular} \end{table*} \begin{figure}[tbp] \subfigure{ \includegraphics[width=0.354\textwidth]{machcoptic-eps-converted-to.pdf} } \subfigure{ \includegraphics[width=0.358\textwidth]{wakePotentialVsM-eps-converted-to.pdf} } \subfigure{ \includegraphics[width=0.358\textwidth]{wakePosiVsM-eps-converted-to.pdf} } \caption{(a) Normalized wake potential profile along the $x = y = 0$ axis for distinct ion drift velocities. Variation of the maximum wake potential is shown in (b) and its position with drift speed is given in (c). The lines in (b) and (c) provide a high order polynomial fit to the data.} \label{fig:wakeAnalysis} \end{figure} Once cluster symmetry was broken, spontaneous rotation was observed. An asymmetric $N = 5$ cluster is shown in Fig. \ref{fig:asymmetricStruc}. (A movie showing the complete rotation of this cluster is attached as Supplemental Material.) The direction of rotation of such asymmetric clusters can be either clockwise or counterclockwise, depending on cluster chirality. (See Fig. \ref{fig:helix} (a) and (b), for two five-particle clusters, along with their reconstructed 3D models as shown in Figs. \ref{fig:helix} (c) and (d).) The clusters shown in Fig. \ref{fig:helix} (a) and (b) rotated counterclockwise and clockwise, respectively, once formed. (Two movies are attached in the Supplemental Material to demonstrate this chirality-related rotation.) \begin{figure}[tbp] \centering \subfigure{ \includegraphics[width=0.37\textwidth]{copticOmegaVsMforPower-eps-converted-to.pdf} } \subfigure{ \includegraphics[width=0.37\textwidth]{copticOmegaVsMforPressure-eps-converted-to.pdf} } \subfigure{ \includegraphics[width=0.37\textwidth]{copticOmegaVsMforSymmetric-eps-converted-to.pdf} } \caption{Calculated rotation speeds $\Omega$ of asymmetric $N = 5$ clusters as a function of the ion drift velocity for a fixed pressure of 150 mTorr (a) and a fixed power of 1.92 W (b). Variation of $\Omega$ with drift speed for two symmetric structures (c) at a pressure of 150 mTorr. Here $Q_d = 13000$e and the downstream grains are assumed to have a charge $0.8Q_d$. Symbols indicate the drift velocity required to match the rotation speed observed experimentally.} \label{fig:omegaAnalysis} \end{figure} \begin{table}[tbp] \setlength{\tabcolsep}{1.15em} \caption{Ion drift speed determined using varying values of $Q_d$ and the decharging factor of downstream grains under specific rf powers at 150 mTorr.} \label{tab:machTable} \begin{tabular}{l c c c c} \hline\hline \multicolumn 1 {c}{Power} & \multicolumn 1 {c}{Decharging} & \multicolumn 3 {c}{$Q_d (e)$} \\ \cline{3-5} (W) &$(Q_d)$ &12000 &13000 &14000 \\ \hline 1.76 &0.7 &0.92 &0.96 &0.97 \\ 1.76 &0.8 &0.95 &0.97 &0.98 \\ 1.76 &0.9 &0.96 &0.97 &0.98 \\ 1.83 &0.7 &1.01 &1.03 &1.04 \\ 1.83 &0.8 &1.02 &1.04 &1.05 \\ 1.83 &0.9 &1.03 &1.05 &1.06 \\ 1.89 &0.7 &1.08 &1.10 &1.11 \\ 1.89 &0.8 &1.09 &1.11 &1.12 \\ 1.89 &0.9 &1.10 &1.12 &1.13 \\ \hline\hline \end{tabular} \end{table} Fig. \ref{fig:trajec} (a) and (b) illustrate representative particle trajectories in the horizontal plane (i.e., imaged by the top view camera) for the asymmetric cluster shown in Fig. \ref{fig:asymmetricStruc} and symmetric structure shown in Fig. \ref{fig:symmetricStruc} (c), respectively. Interestingly, the center of rotation for the asymmetric cluster is not located at the projection of the cluster's COM in the horizontal plane, which is given by $\vec{r}_{com} = \sum \vec{r}_i/N$, where $\vec{r}_i$ is the position of each dust particle with respect to the center of the box and height above the lower electrode and $N$ is the total number of particles comprising the cluster. Fig. \ref{fig:trajec} (c) and (d) show the rotational orientation of the clusters over time. As shown, the asymmetric cluster exhibits a uniform angular rotation speed, which increases as the power is decreased (Fig. 5(c)) while Fig. \ref{fig:trajec} (d) shows only a small change in orientation of the symmetric cluster, with a maximum rotation speed of 0.055 s$^{-1}$. The angular speed $\omega$ and the height of the COM $h_{COM}$ of the clusters are summarized in Table \ref{tab:torqueTable1} for various experimental conditions. For fixed rf power, the angular speed of the cluster decreases with increasing pressure as shown. \section{Rotational mechanisms and discussion} We propose that the spontaneous rotation observed for the small clusters described in this experiment is induced by the torque due to the ion wake field force when applied to the cluster once cluster symmetry is broken. At equilibrium, the net torque $\vec{\tau}_{net}$ that causes the cluster's rotation is balanced by the torque $\vec{\tau}_{d}$ due to the neutral drag force created by the cluster's uniform rotation, \begin{equation} \vec{\tau}_{net} = \vec{\tau}_{d}. \end{equation} The neutral drag torque $\vec{\tau}_{d}$ is given as \begin{equation} \vec{\tau}_{d} = \sum_{i=1}^{N'}\vec{r_j} \times \vec{F}_{dj}, \end{equation} where $\vec{F}_{dj} = -m_d\beta\vec{v}_j$ is the neutral drag force applied on the $j$th particle, $\vec{r}_j$ is the position of the particle measured from the axis of rotation, $\vec{v}_j$ is the tangential velocity of the $j$th dust particle and $\beta$ is the Epstein drag coefficient defined as \begin{equation} \beta = \delta\frac{8}{\pi}\frac{P}{a\rho v_{th,n}}, \end{equation} where $\delta$ is a coefficient depicting the reflection of the neutral gas atoms from the surface of the dust, ($\delta = 1.26$ $\pm$ $0.13$ for MF particles in argon gas ~\cite{binliu}), $P$ is the gas pressure, $a$ the particle radius, $\rho$ is the particle's mass density and $v_{th,n} = \sqrt{8k_BT_n/\pi m_n}$ is the mean thermal velocity of the neutral gas. The temperature of the neutral gas is taken to be $T_n = 300$ K and the mass of the argon gas $m_n = 6.64 \times 10^{-26}$ kg. The neutral drag torque $\vec{\tau}_{d}$ is calculated and summarized in Table \ref{tab:torqueTable1} for four different clusters under different experimental conditions. The torque driving the rotation can be written as \begin{equation} \vec{\tau}_{net} = \sum_{j=1}^{N} \vec{r_j} \times \vec{F}_j, \end{equation} where $\vec{F}_j$ is the total force exerted on the $j$th particle excluding the neutral drag force, and is given by \begin{equation} \vec{F}_{j} = \vec{F}_{elecj} + \vec{F}_{ionj} + \vec{F}_{interj} \end{equation} with $\vec{F}_{elecj}$ being the electric field force, $\vec{F}_{ionj}$ the ion wake field force, and $\vec{F}_{interj}$ the interparticle force from all other particles exerted on the $j$th particle. Inasmuch as $\vec{F}_{elecj} = \vec{\nabla} U_j$ is a conservative force, zero work is done by $\vec{F}_{elecj}$ moving a dust particle through a complete rotational trajectory, i.e. $\oint \vec{F}_{elecj} \cdot d\vec{r}_j = 0$. As such, $\vec{F}_{elecj}$ will not produce steady-state rotation for either symmetric or asymmetric structures since it cannot feed energy to the system ~\cite{flanagan09}. $\vec{F}_{interj}$ is an internal force between dust particles and can not contribute to rotation of the structures. This leaves the ion wake field force $\vec{F}_{ionj}$ as one possible contributor to the observed rotation. Thus, Eq. (4) can now be rewritten as \begin{equation} \vec{\tau}_{net} = \sum_{j=1}^{N}\vec{r_j} \times \vec{F}_{ionj}. \end{equation} In order to determine $\vec{F}_{ionj}$, a point charge model was employed to model the ion wake field ~\cite{qiao13, qiao14, vladimirov95, goree95, ishihara97, lampe00, ivlev03, kompaneets07, zhdanov09}. Assuming the ion wakefield acts as a positive point charge located beneath each dust particle, the ion wake field force experienced by the $j$th dust particle $\vec{F}_{ionj}$ is given by \begin{equation} \vec{F}_{ionj} = \sum_{k \neq j}^{N}\frac{Q_dq_w(\vec{R}_k - \vec{r}_j)}{4\pi\varepsilon_0|\vec{R}_k - \vec{r}_j|^3}, \end{equation} where $Q_d$, $q_w$ are the dust charge and wakefield point charge, $\vec{R}_k = \vec{r}_k - z_w\hat{z}$ is the location of the point charge located a distance $z_w$ beneath the $k$th particle, and $\varepsilon_0$ is the vacuum permittivity. Since the cluster's rotation axis is in the vertical direction, only the horizontal component of $\vec{F}_{ionj}$ contributes to the driving torque for the rotation. The location ($z_w$) and magnitude ($q_w$) of the wakefield point charge depends on the experimental conditions, since the power and pressure settings determine the particle charge and ion drift speed. Changes to the rf power also alter the electron and ion density, as well as change the electron temperature, which determines the bias on the lower electrode (establishing the ion drift velocity) and the dust surface charge. The electron Debye length under representative experimental conditions was estimated based on the results presented in Ref. ~\cite{kong14, nosenko14} (see Table \ref{tab:torqueTable1}). The charge on a dust grain within the sheath of a rf discharge is generally on the order of 1000e per $\mu$m diameter. Using the result from previous experiments under similar experimental conditions the dust charge was assumed to be $\sim$12700e ~\cite{kong14}. However, we analyzed the motion assuming $Q_d = 12000$e, 13000e, and 14000e to determine the extent to which the dust charge influences the rotation rate. Additionally, theoretical and experimental results have shown that downstream dust grains are decharged relative to the upstream grains ~\cite{block15}. Accordingly, a charge of 0.7, 0.8, and 0.9$Q_d$ was assumed for the lower grains in a cluster. (See Table \ref{tab:machTable}.) Estimates for the point charge and its location downstream from a particle were obtained employing the COPTIC (Cartesian mesh, oblique boundary, particles and thermals in cell) code developed by Hutchinson ~\cite{hutch11pop, hutch11prl, hutch12pre, hutch13pop, hutch13ppcf}. In this simulation, grains are represented as point charges immersed in a collisionless plasma using uniform external drifting-Maxwellian ion distributions with $T_i/T_e = 0.01$. Calculations are performed on a $44 \times 44 \times 96$ cell grid with nonuniform mesh spacing over a cubical domain of $ 10 \times 10 \times 25$ Debye lengths, where the ions are flowing along the $\hat{z}$-direction with a drift velocity $v_d$ expressed as a Mach number $M = v_d/c_s$ where $c_s = \sqrt{T_e/m_i}$ is the cold-ion sound speed. The code is run with the point charge representing a dust particle located at position $(0,0,0)$. The analytical part of this point charge extends to radius $r_p = 0.1 \lambda_{De}$. At this distance, the floating potential $\phi_p = -0.25T_e/e$ with $T_e = 2.585$ eV. Distinct drift velocities ranging from 0.1 to 3.3 were used in the COPTIC program to determine the maximum value of the wake potential and its location. Fig. \ref{fig:wakeAnalysis} (a) shows the wake potential profile along the axial direction normalized to the dust grain potential as a function of the ion drift velocity $M$. As can be seen, the maximum wake potential $\phi_{max}$ achieves its peak value for $M = 0.8$ (Fig. \ref{fig:wakeAnalysis} (b)), with its position $z_w$ shifting further away from the dust grain for increasing drift velocity (see Fig. \ref{fig:wakeAnalysis} (c)). The magnitude of the wakefield point charge $q_w$ can be calculated as $q_w \approx Q_d\phi_{max}/|\phi_p|$, where $\phi_p$ is the value of the dust surface potential. The theoretical rotation speed $\Omega$ can now be calculated based on $q_w$ and $z_w$ where using the COPTIC model to determine the ion flow velocity which best matches the experimental results. Assuming $\lambda_{De}$ for the experimental conditions shown in Table \ref{tab:torqueTable1}, the magnitude and location of the wake point charge over the range of ion drift velocities were fit employing a higher order polynomial, and then used to calculate the torque on each of the clusters listed in Table \ref{tab:torqueTable1}. This torque was then equated to the neutral drag torque (Eq. 2) to determine the values of $q_w$ and $z_w$ needed to balance the torques, allowing an estimate of the ion drift speed to be obtained. As shown in Table \ref{tab:machTable}, the ion drift speed found using all possible values of $Q_d$ varies by less than $1.8\%$. The results of these calculations assuming an upstream dust charge $Q_d = 13000$e and all estimates of decharging for the downstream particle are shown in Fig. \ref{fig:omegaAnalysis} and Table \ref{tab:torqueTable1}. As shown in Fig. \ref{fig:omegaAnalysis}, there are always two values of $M$ which produce a rotational speed matching the experimentally measured value, one for $M < 0.7$ and one for $M > 0.7$. As observed in this experiment, the levitation height of the cluster decreases as the power is increased, as does the rotation rate. As the ion drift velocity $M$ increases closer to the lower electrode ~\cite{douglass11} the trend for decreasing $\Omega$ with increasing power (and thus increasing $M$) points to ion drift velocities $> 0.7$, as shown in Fig. \ref{fig:omegaAnalysis} (a). At fixed power, reducing the pressure causes a cluster's rotation speed to increase while the height of its COM increases. Thus, the Mach number should decrease with decreasing pressure, as is seen in Fig. \ref{fig:omegaAnalysis} (b). Finally, as shown in Fig. \ref{fig:omegaAnalysis} (c), the rotation rates for symmetric clusters are very small over a wide range of ion drift velocities. Calculated ion drift speeds are consistent with the expected increase in these values, given the power range explored in the experiment. According to the trends shown in Fig. \ref{fig:omegaAnalysis} (a) and (b), as the power and pressure are increased further, the rotation speeds of the clusters should be reduced to almost negligible amounts. However, this was not observed experimentally since when the power or pressure exceeded certain critical values, the structure of the cluster changed. Thus asymmetric structures were always observed to have rotation rates on the order of 1-10 rad/s. \vspace{7pt} \section{Conclusions} Clusters of a small number of dust particles were produced within a glass box placed on the lower electrode of a GEC rf cell. Self-excited rotation was observed for asymmetric structures with a uniform rotation speed, whereas no appreciable rotation was produced for symmetric structures. The asymmetric clusters were found to rotate about a vertical axis not passing through the center of mass. It was proposed that the spontaneous rotation for the small asymmetric dust clusters observed is probably induced by the net torque applied on the cluster due to the ion wake force. It was shown that symmetric clusters experience a very small net torque, and do not rotate. The rotation direction of the asymmetric cluster was determined by the conformational chirality of the specific structure, causing the cluster to spin either clockwise or counterclockwise. The torque induced by the ion wake force was calculated employing the ion wakefield point charge model, where the magnitude and location of the wakefield point charge was determined using the COPTIC code. Balancing the opposing torques induced by gas drag and the ion wake field allows the ion flow to be estimated within the glass box, which was found to be $\sim$1.0 $M$ for rf power $1.7 < P < 2.0$ W. This result is consistent with the values generally assumed for these experimental conditions ~\cite{hutch11prl}. These results are in rough agreement wiht Nosenko $et$ $al.$ ~\cite{nosenko12} who also found rotating particle pairs which they ascribed to the interaction with the ion wake field. Using the theory of Lampe $et$ $al.$ ~\cite{lampe12}, they estimated the Mach number of the ion flow to be 2.26 in the plasma sheath of an rf discharge at 157 mTorr and 5 W. Higher Mach numbers were also suggested by the results of this experiment in analyzing the small rotations observed for symmetric clusters formed at higher rf power. \section*{Acknowledgment} Support from NSF/DOE Grant No. 1414523 and NSF/NASA Grant No. 1740203 is gratefully acknowledged.
{ "redpajama_set_name": "RedPajamaArXiv" }
5,716
Q: Carousel uneven when there aren't equal number of posts If I don't have 8 posts the carousel looks like this. Here is the Wordpress loop <div class="section-title"> <h1>Most Recent Post</h1> </div> <div id="recent-post-carousel" class="carousel slide" data-ride="carousel"> <ol class="carousel-indicators"> <li data-target="#recent-post-carousel" data-slide-to="0" class="active"></li> <li data-target="#recent-post-carousel" data-slide-to="1"></li> </ol> <div class="carousel-inner"> <?php // Get posts (tweak args as needed) $i=0; $args = array( 'post_type' => 'post', 'posts_per_page' => -1, 'orderby' => "date", 'order' => "desc" ); $posts = get_posts( $args ); ?> <?php foreach (array_chunk($posts, 4, true) as $posts) : ?> <div class="item <?php if ($i==0){echo 'active';}?>"> <div class="row"> <?php foreach( $posts as $post ) : setup_postdata($post); ?> <div class="col-sm-6"> <div class="single-post"> <div class="pull-left post-image"> <a href="#"> <?php the_post_thumbnail( 'full' ); ?> <i class="fa fa-angle-right"></i> </a> </div> <div class="pull-right post-details"> <p class="post-date">03 Dec 2014</p> <p><?php echo $i?></p> <a href="#"><h5><a href="<?php the_permalink() ?>" rel="bookmark" title="<?php the_title(); ?>"><?php the_title(); ?></a> </h5></a> <span>John doe</span> <p><?php echo substr(get_the_excerpt(), 0,99).' [...]'; ?></p> </div> </div> </div> <?php $i++ ?> <?php endforeach; ?> </div> </div> <?php endforeach; ?> </div> </div> </div> Not sure if it has something to do with wordpress, i tried it on a static page and it worked fine. one way to fix it is to remove left or right margin from the col-sm-6, but i don't think this is a good way to do things. A: I have created a fiddle for you. In fiddle above one is your case and the below one is Case with min-height(solved). **https://jsfiddle.net/Anuj_Kumar/L5uduxLr/1/embedded/result/** If still it's not fixed then try adding class "cleafix" with "single-post".
{ "redpajama_set_name": "RedPajamaStackExchange" }
8,275
package ru.job4j.tracker; /** * Класс для работы с пользователем. * @author Nikolay Matveev. * @since 18.10.2017 * @version 0.1 */ public class StartUI { /** Ссылка массив целых чисел. */ private int[] range; /** Ссылка типа инпут. */ private Input input; /** Ссылка типа Tracker. */ private Tracker tracker; /** * Конструктор для класса StartUI. * @param input - ссылка типа инпут * @param tracker - ссылка типа трэкер. */ public StartUI(Input input, Tracker tracker) { this.input = input; this.tracker = tracker; } /** Метод инициализирующий объект трекер и главное меню программы.*/ public void init() { MenuTracker menu = new MenuTracker(input, tracker); menu.initActions(); range = menu.getRange(); do { menu.show(); menu.select(input.ask("Select: ", range)); } while (!"y".equals(this.input.ask("Exit programm?(y): "))); } /** * Точка входа в программу. * @param args - String[] */ public static void main(String[] args) { Input input = new ValidateInput(); Tracker tracker = new Tracker(); tracker.init(); new StartUI(input, tracker).init(); } }
{ "redpajama_set_name": "RedPajamaGithub" }
2,886
Q: What robust test should I use in order to find the correlation between two numeric vectors in R? I have 2 numeric vectors: A = [1] 0.09112019 0.01648917 0.09959314 0.18508083 0.43382979 0.47615469 0.02759358 0.20501685 0.11723475 [10] 0.25235056 1.01360047 0.23293548 0.02809754 0.18917008 0.12235214 0.25779546 1.11210158 0.29427705 [19] 0.46955788 0.34303692 0.26483973 0.12400529 0.77529471 0.05599909 0.08754854 0.16293734 0.20511528 [28] 0.64192924 0.15366982 0.57283905 0.29810925 0.54156768 0.06472627 0.06320937 0.07423829 0.05349911 [37] 0.45069070 0.58086056 0.17868721 0.12797566 0.18313978 0.38640191 0.09796483 0.15190912 B = [1] 1586 200 315 489 200 2044 306 271 253 610 282 200 799 200 200 200 400 628 289 447 258 [22] 200 200 375 200 200 200 280 609 779 200 200 200 200 703 200 309 200 200 200 200 200 [43] 886 412 My hypothesis is that when A goes up, B also goes up, and I want to calculate the correlation between these two vectors and visualize it. These two vectors are not normally distributed. The scatterplot does not clearly show the correlation, it is very hard to infer anything from it. Pearson correlation gave me a negative correlation, while Spearman gave me a postivie correlation. Both of them gave very hight p-value, about 0.9, so both of them are not significant. Hence, I cant figure it out.. I just need to find the correlation score, the right way. This is the scatterplot:
{ "redpajama_set_name": "RedPajamaStackExchange" }
101
\section{Introduction\label{sec:intro}} Virtually contact structures naturally appear in classical mechanics in the study of magnetic flows on compact Riemannian manifolds $(Q,h)$ of negative sectional curvature. The appearance of the magnetic $2$-form $\sigma$ on $Q$ is reflected in the use of the twisted symplectic form on $T^*Q$ obtained by adding the pull back of $\sigma$ along the cotangent bundle projection to $\mathrm d\mathbf{p}\wedge\mathrm d\mathbf{q}$. As it turns out, energy surfaces $M\subset T^*Q$ of twisted cotangent bundles need not to be of contact type in general. It was pointed out by Cieliebak--Frauenfelder--Parternain \cite{cfp10} that in many interesting cases a certain covering $\pi\colon\thinspace M'\rightarrow M$ of the energy surface $M\subset T^*Q$ admits a contact form $\alpha$ whose Reeb flow projects to the Hamiltonian flow on the energy surface $M\subset T^*Q$ up to parametrization. Moreover, the contact form $\alpha$ admits uniform upper and lower bounds with respect to a lifted metric. In this situation, the manifold $M$ together with the odd-dimensional symplectic form $\omega$ obtained by restriction of the twisted symplectic form to $TM$ is called a virtually contact manifold. In particular, questions about periodic orbits on virtually contact manifolds $(M,\omega)$ can be answered on the covering space $M'$ with help of the contact form $\alpha$. If the covering space $M'$ of a virtually contact manifold $(M,\omega)$ is compact, and hence the covering $\pi$ is finite, the energy surface $M$ will be of contact type. The existence question about periodic orbits in this case is subject to the Weinstein conjecture, see \cite{wein79}, and the virtually contact manifold $(M,\omega)$ is called to be trivial. If the covering $\pi$ is infinite with a non-amenable covering group, one is intended to study periodic orbits on a non-compact contact manifold $(M',\alpha)$. This is because the covered energy surface $M$ is not necessarily of contact type. In general, open contact manifolds do admit aperiodic Reeb flows as the standard contact form $\mathrm d z+\mathbf{y}\mathrm d\mathbf{x}$ on Euclidean spaces shows. In order to achieve existence of periodic Reeb orbits additional conditions are required, cf.\ \cite{bae14, bpv09, bprv13, cfp10, dpp15, sz16}. It was asked by G.\ P.\ Paternain whether virtually contact manifolds have to admit periodic orbits. The question was answered positively in many instances by Cieliebak--Frauenfelder--Parternain \cite{cfp10} and, more recently, by Bae--Wiegand--Zehmisch \cite{bwz}. The content of the following theorem is to give a large class of examples to which the existence theory developed in \cite{bwz} applies. \begin{thm} \label{thm:mainthm} For all $n\geq2$ there exist non-trivial closed virtually contact manifolds $M$ of dimension $2n-1$ which topologically are a connected sum such that the corresponding belt sphere represents a non-trivial homotopy class in $\pi_{2n-2}M$. The involved covering space $M'$ is obtained by covering contact connected sum. \end{thm} The virtually contact structures studied by Cieliebak--Frauenfelder--Parternain \cite{cfp10} are diffeomorphic to unit cotangent bundles of negatively curved manifolds. The examples we are going to construct in Section \ref{subsec:pfofthm} are obtained by covering connected sum, which is an extension of the contact connected sum operation to the class of virtually contact manifolds. In Section \ref{subsec:st*qisprim} we will show that unit cotangent bundles of aspherical manifolds are prime. This implies that the covering connected sum produces virtually contact structure that differ from those studied in \cite{cfp10}. Motivated by Hofer's \cite{hof93} verification of the Weinstein conjecture for closed overtwisted contact $3$-manifolds Bae \cite{bae14} constructed virtually contact manifolds in dimension $3$ using a covering version of the Lutz twist. The topology of the base manifold of the covering thereby stays unchanged. The total space of the resulting covering is an overtwisted contact manifold and the virtually contact structure will be non-trivial. In Proposition \ref{prop:pertofcontwnegcurv} we present a tool to produce more examples of that nature. Let us remind that non-trivially here and in Theorem \ref{thm:mainthm} means that the symplectic form on the odd-dimensional manifold is not the differential of a contact form. The verification of the Weinstein conjecture by Hofer \cite{hof93} for closed reducible $3$-manifolds suggests the question about the existence of non-trivial virtually contact $3$-manifolds with non-vanishing $\pi_2$. This question is answered by Theorem \ref{thm:mainthm}. In fact, the results in \cite{grz14,grz16,gz16a,gz16b,gnw16} motivated the definition of the covering contact connected sum. Extending the work of Geiges--Zehmisch \cite{gz16a} the existence of periodic orbits for virtually contact structures addressed by Theorem \ref{thm:mainthm} that in addition admit a $C^3$-bounded contact form on the total space of the covering is shown in \cite{bwz}. In Section \ref{sec:morsepot} we will give a second construction of virtually contact structures that will be obtained via energy surfaces of classical Hamiltonian functions in twisted cotangent bundles. The corresponding energy will be below the Ma\~n\'e critical value of the involved magnetic system so that the energy surfaces intersect the zero section of the cotangent bundle. The topology of the energy surface is determined by the potential function on the configuration space according to Morse theoretical considerations. \begin{thm} \label{thm:2ndthm} For any $n\geq2$ and given $b\in\mathbb N$ there exists a closed virtually contact manifold $M$ of dimension $2n-1$ such that $\pi_nM$ and the image in $H_nM$ under the Hurewicz homomorphism, resp., contain a subgroup isomorphic to $\mathbb Z^b$. The virtually contact manifold $M$ appears as the energy surface of a classical Hamiltonian function in a twisted cotangent bundle $T^*Q$. The rank $b$ of the subgroup $\mathbb Z^b$ is the first Betti number of the configuration space $Q$. If $n\geq3$ the virtually contact structure on $M$ is non-trivial. \end{thm} Based on the work of Ghiggini--Niederkr{\"u}ger--Wendl \cite{gnw16} existence of periodic solutions in the context of Theorem \ref{thm:2ndthm} can be shown provided that the magnetic form has a $C^3$-bounded primitive on the universal cover of $Q$, see \cite[Theorem 1.1 and 1.2]{bwz}. Furthermore, by the classification obtained by Barth--Geiges--Zehmisch in \cite[Theorem 1.2.(a)]{bgz} the contact structure on $M$ obtained by homotoping the magnetic term of the twisted cotangent bundle $T^*Q$ to zero is different from the standard contact structure on the unit cotangent bundle $ST^*P$ of any Riemannian manifold $P$. \section{A construction via surgery\label{sec:construction}} \subsection{Definitions\label{subsec:definitions}} The following terminology was introduced in \cite{bae14, cfp10}. Let $M$ be a $(2n-1)$-dimensional manifold for $n\geq2$. A closed $2$-form $\omega$ on $M$ is called {\bf symplectic} if $\ker\omega$ is a $1$-dimensional distribution. The pair $(M,\omega)$ is an {\bf odd-dimensional symplectic manifold}. It is called {\bf virtually contact} if the following two conditions are satisfied: {\bf Primitive:} There exist a covering $\pi\colon\thinspace M'\rightarrow M$ and a contact form $\alpha$ on $M'$ such that $\pi^*\omega=\mathrm d\alpha$, so that $\alpha$ is a primitive of the lift of $\omega$ and $\alpha$ defines a contact structure $\xi=\ker\alpha$ on the covering space $M'$. {\bf Bounded geometry:} There exist a metric $g$ of bounded geometry on $M$ and a constant $c>0$ subject to the following geometric bounds: \[ \sup_{M'}|\alpha|_{(\pi^*g)^{\flat}}<\infty \label{eq:gb1}\tag{gb$_1$} \] with respect to the dual of the pull back metric $\pi^*g$; and for all $v\in\ker\mathrm d\alpha$ \[ |\alpha(v)|>c|v|_{\pi^*g}\,. \label{eq:gb2}\tag{gb$_2$} \] If the manifold $M$ is closed any metric $g$ will be of {\bf bounded geometry}, i.e.\ the injectivity radius $\inj_g>0$ of $(M,g)$ is positive and the absolut value of the sectional curvature $|\!\sec_g\!|$ is bounded. The tuple \[ \big(\pi\colon\thinspace M'\rightarrow M,\alpha,\omega,g\big) \] is called {\bf virtually contact structure} and $(M,\omega)$ a {\bf virtually contact manifold}. A virtually contact manifold is {\bf non-trivial} if $\omega$ is not the differential of a contact form on $M$. In particular, the covering $\pi$ of a non-trivial virtually contact structure is infinite and $M$ has a non-amenable fundamental group. A virtually contact structure is called {\bf somewhere contact} if there exist an open subset $U$ of $M$ and a contact form $\alpha_U$ on $U$ such that $\pi^*\alpha_U=\alpha$ on $\pi^{-1}(U)$. \subsection{Covering connected sum\label{subsec:covconsum}} For $i=1,2$ we consider two somewhere contact virtually contact structures $\big(\pi_i\colon\thinspace M'_i\rightarrow M_i,\alpha_i,\omega_i,g_i\big)$. Denote by $U_i$, $i=1,2$, an open subset of $M_i$ on which a contact form $\alpha_{U_i}$ exists according the the definition of being somewhere contact. Given a bijection $b$ between the fibers of the coverings $\pi_1$ and $\pi_2$ over the respective base points of $M_1$ and $M_2$ we define a covering connected sum as follows: Let $D_i^{2n-1}$, $i=1,2$, be a closed embedded disc contained in $U_i$ such that a neighbourhood of the disc is equipped with Darboux coordinates for the contact form $\alpha_{U_i}$. We perform contact index-$1$ surgery as described in \cite{gei08} identifying $\partial D_i^{2n-1}$ with the boundary $\{i\}\times S^{2n-2}$ of the upper boundary of $[1,2]\times S^{2n-2}$ the $1$-handle $[1,2]\times D^{2n-1}$. The resulting contact form on the connected sum $U_1\#U_2$ is denoted by $\alpha_{U_1}\#\alpha_{U_2}$. Notice, that $\alpha_{U_1}\#\alpha_{U_2}$ coincides with $\alpha_{U_i}$ on $U_i\setminus D_i^{2n-1}$. Let $\omega$ be the odd-dimensional symplectic form on $M_1\#M_2$ that coincides with $\omega_i$ on $M_i\setminus U_i$ for $i=1,2$ and with $\mathrm d(\alpha_{U_1}\#\alpha_{U_2})$ on $U_1\#U_2$. Similarly, a metric $g$ of bounded geometry can be defined via extension of $g_1$ and $g_2$ over the handle part. In order to define a connected sum of the coverings $\pi_i$ we may assume that the base point $x_i$ of $M_i$ lies on the boundary of $D_i^{2n-1}$. Moreover, we choose the subset $U_i$, $i=1,2$, so small such that $\pi_i^{-1}(U_i)$ decomposes into a disjoint union of open sets $U_i^y$, $y\in\pi_i^{-1}(x_i)$, and that the restriction of $\pi_i$ to $U_i^y$ is an embedding into $M_i$ for all $y\in\pi_i^{-1}(x_i)$. Then, topologically, we define a family of connected sums $U_1^y\#U_2^{b(y)}$ according to the bijection $b$ between the fibers over the base points. The restrictions of the contact forms $\alpha_i|_{U_i^y}$ correspond to the local contact form $\alpha_{U_i}$ diffeomorphically via $\pi_i$, $i=1,2$. A contact form on \[ U_1^y\#U_2^{b(y)} \] can be defined equivariantly via contact connected sum as follows: Let $M'_1\#_bM'_2$ be the manifold obtained by gluing $M'_i\setminus\pi_i^{-1}(U_i)$, $i=1,2$, with $U_1^y\#U_2^{b(y)}$, $y\in\pi_i^{-1}(x_1)$, along their boundaries in the obvious way. We obtain a covering \[ \pi\colon\thinspace M'_1\#_bM'_2\longrightarrow M_1\#M_2 \] that restricts to $\pi_i$ on $M'_i\setminus\pi_i^{-1}(U_i)$, $i=1,2$, and defines the trivial covering over the handle parts being the identity restricted to each of the sheets. Then $M'_1\#_bM'_2$ carries a contact form $\alpha$ whose restriction to the union of the $U_1^y\#U_2^{b(y)}$, $y\in\pi_1^{-1}(x_1)$, coincides with $\pi^*\big(\alpha_{U_1}\#\alpha_{U_2}\big)$ and that restricts to $\alpha_i$ on $M'_i\setminus\pi_i^{-1}(U_i)$, $i=1,2$. Because each of the involved handles is compact the covering $\pi\colon\thinspace M'\rightarrow M$ of $M=M_1\#M_2$ by $M'=M'_1\#_bM'_2$ defines a virtually contact structure given by $\big(\pi\colon\thinspace M'\rightarrow M,\alpha,\omega,g\big)$. \begin{rem} \label{rem:conthandle} Observe, that the modle contact handle used for the contact connected sum carries obvious periodic characteristics of $\ker\big(\mathrm d(\alpha_{U_1}\#\alpha_{U_2})\big)$ inside the {\bf belt sphere} $\{3/2\}\times S^{2n-2}$. The situation changes after a perturbation of $\alpha_{U_1}\#\alpha_{U_2}$ obtained by a multiplication with a positive function that is constantly equal to $1$ in the complement of the handle. This operation changes the virtually contact structure on the connected sum $M=M_1\#M_2$ but not the contact structure $\xi=\ker\alpha$ on the covering $M'$. Still, there exists a contact embedding of the modle contact handle into $(M',\xi)$. \end{rem} \begin{lem} \label{lem:nontrivaftercovconsum} For $i=1,2$ let $\big(\pi_i\colon\thinspace M'_i\rightarrow M_i,\alpha_i,\omega_i,g_i\big)$ be a somewhere contact virtually contact structure. If $\omega_1$ is non-exact, then the odd-dimensional symplectic form $\omega$ on $M_1\#M_2$ corresponding to the virtually contact structure \[ \big(\pi\colon\thinspace M'\rightarrow M,\alpha,\omega,g\big) \] obtained by covering contact connected sum is non-exact. \end{lem} \begin{proof} We argue by contradiction and continue the use of notation from above. Suppose that the symplectic form $\omega$ on the $(2n-1)$-dimensional connected sum $M=M_1\#M_2$ has a primitive. Then the restriction $\omega_1$ of $\omega$ to $M_1\setminus D^{2n-1}_1$ does. An interpolation argument for primitives in terms of Mayer--Vietoris sequence in de Rham cohomology using $H^1_{\dR}(S^{2n-2})=0$ shows that the odd-dimensional symplectic form $\omega_1$ on $M_1$ has a primitive. A more elementary argument goes as follows: Denote the primitive of the restriction of $\omega_1$ to $M_1\setminus D^{2n-1}_1$ by $\lambda$. Observe that $\lambda|_U$ is a closed $1$-form and, hence, exact in a neighbourhood $D'$ of the disc $D^{2n-1}_1$. Cutting a primitive function of $\lambda|_{D'}$ down to zero in radial direction we can assume that $\lambda$ vanishes near $\partial D^{2n-1}_1\subset U\subset M$. In other words, a perturbation of $\lambda$ extends over $D^{2n-1}_1$ by zero resulting in a primitive of $\omega_1$. This is a contradiction. \end{proof} \subsection{Magnetic flows\label{subsec:magflow}} Virtually contact structures appear naturally on energy surfaces of classical Hamiltonians on twisted cotangent bundles. We briefly recall the construction following \cite{bz15, cfp10}. Let $(Q,h)$ be a closed $n$-dimensional Riemannian manifold and let $\sigma$ be a closed $2$-form on $Q$, which is called the {\bf magnetic form}. The {\bf Liouville form} on the cotangent bundle $\tau\colon\thinspace T^*Q\rightarrow Q$ is the $1$-form $\lambda$ on the total space $T^*Q$ that is given by $\lambda_u=u\circ T\tau$ for all covectors $u\in T^*Q$. The {\bf twisted symplectic form} by definition is $\omega_{\sigma}=\mathrm d\lambda+\tau^*\sigma$. For a smooth function $V$ on $Q$, the so-called {\bf potential}, and the dual metric $h^{\flat}$ of $h$ we consider the Hamiltonian of classical mechanics \[ H(u)=\frac12|u|^2_{h^{\flat}}+V\big(\tau(u)\big)\,. \] For energies $k>\max_{Q}V$ we consider the energy surfaces $\{H=k\}$, which are regular and in fact diffeomorphic to the unit cotangent bundle $ST^*Q$ via a diffeomorphism induced by a fibrewise radial isotopy. It is of particular interest whether the Lorentz force induced by the magnetic $2$-form $\sigma$ comes from a potential $1$-form. Up to lifting $\sigma$ to a certain cover this will be the case at least for so-called weakly exact $2$-forms: Denoting by $\mu\colon\thinspace\widetilde{Q}\rightarrow Q$ the universal covering of $Q$ we call the $2$-form $\sigma$ on $Q$ {\bf weakly exact} if there exists a $1$-form $\theta$ on $\widetilde{Q}$ such that $\mu^*\sigma=\mathrm d\theta$. In the following we will assume that the magnetic form $\sigma$ is weakly exact. Therefore, it is natural to lift the Hamiltonian system to the universal cover. The covering map $\mu$ induces a natural map $T^*\mu\colon\thinspace T^*\widetilde{Q}\rightarrow T^*Q$ that is given by \[ \tilde{u}\longmapsto\tilde{u}\circ\big(T\mu_{\tilde{\tau}(\tilde{u})}\big)^{-1}\,, \] where $\tilde{\tau}\colon\thinspace T^*\widetilde{Q}\rightarrow\widetilde{Q}$ denotes the cotangent bundle of $\widetilde{Q}$ and $\mu_{\tilde{\tau}(\tilde{u})}$ is the germ of local diffeomorphism at $\tilde{\tau}(\tilde{u})$ that coincides with $\mu$ near $\tilde{\tau}(\tilde{u})$. Naturallity can be expressed by saying that $\mu\circ\tilde{\tau}=\tau\circ T^*\mu$ so that \[ \big(T^*\mu\big)^*\lambda=\tilde{\lambda}\,, \] where $\tilde{\lambda}$ denotes the Liouville form on $T^*\widetilde{Q}$. Moreover, $T^*\mu$ itself is a covering, which because of the homotopy equivalence $T^*\widetilde{Q}\simeq\widetilde{Q}$ can be used to represent the universal covering of $T^*Q$. The lifted Hamiltonian $\widetilde{H}=H\circ T^*\mu$ is a Hamiltonian of classical mechanics \[ \widetilde{H}(\tilde{u})= \frac12|\tilde{u}|^2_{(\tilde{h})^{\flat}}+ \widetilde{V}\big(\tilde{\tau}(\tilde{u})\big)\,, \] $\tilde{u}\in T^*\widetilde{Q}$, with respect to the lifted metric $\tilde{h}=\mu^*h$ and the lifted potential energy function $\widetilde{V}=V\circ\mu$. The preimage of $\{H=k\}$ under $T^*\mu$ is equal to $\{\widetilde{H}=k\}$. In fact, an application of the implicit function theorem yields that the restriction \[ \pi=T^*\mu|_{\{\widetilde{H}=k\}} \] defines a covering projection \[ M'=\{\widetilde{H}=k\} \longrightarrow \{H=k\}=M\,. \] Because there exists a $1$-form $\theta$ on $\widetilde{Q}$ such that $\mu^*\sigma=\mathrm d\theta$ we find that \[ \big(T^*\mu\big)^*\tau^*\sigma=\mathrm d (\tilde{\tau}^*\theta)\,, \] so that \[ \big(T^*\mu\big)^*\omega_{\sigma}= \mathrm d\tilde{\lambda}+\tilde{\tau}^*\mathrm d\theta=: \tilde{\omega}_{\mathrm d\theta} \] has primitive $\tilde{\lambda}+\tilde{\tau}^*\theta$. The restriction to $TM'$ is denoted by \[ \alpha=\big(\tilde{\lambda}+\tilde{\tau}^*\theta\big)|_{TM'}\,. \] Setting $\omega=\omega_{\sigma}|_{TM}$ we obtain a map \[ \pi\colon\thinspace\big(M',\mathrm d\alpha\big)\longrightarrow\big(M,\omega\big) \] of odd-dimensional symplectic manifolds. The question that we will address in the following is under which conditions the $1$-form $\alpha$ will be a contact form on $M'$. \begin{rem} \label{rem:topofpi} The topology of the covering $\pi$ can be determined as follows. By the choice $k>\max_QV$ the covering space $M'$ is diffeomorphic to $ST^*\widetilde{Q}$ so that $M'$ carries the structure of a $S^{n-1}$-bundle over $\widetilde{Q}$. The long exact sequence of the induced Serre fibration shows that the inclusion $S^{n-1}\rightarrow M'$ of the typical fibre yields a surjection of fundamental groups. Therefore, if $Q$ is not a surface, i.e.\ $n>2$, then $M'$ is simply connected and $\pi$ the universal covering. If $Q$ is a surface, then in view of uniformization $\pi$ is a covering of $M=ST^*Q$ with covering space $M'$ equal to $\mathbb R^2\times S^1$ for $Q\neq S^2$; otherwise, if $Q=S^2$, then $\pi$ is the trivial one-sheeted covering of $\mathbb R P^3$. \end{rem} \subsection{Bounded primitive\label{subsec:boundprim}} We assume that the primitive $\theta$ of $\mu^*\sigma$, viewed as a section $\widetilde{Q}\rightarrow T^*\widetilde{Q}$ of $\tilde{\tau}$, is {\bf bounded} with respect to the lifted metric $\tilde{h}$, i.e. \[ \sup_{\widetilde{Q}}|\theta|_{(\tilde{h})^{\flat}} <\infty\,. \] This will be the case for negatively curved Riemannian manifolds $(Q,h)$ as it was pointed out by Gromov \cite{gr91}, see Example \ref{ex:gromovsexample} below. By compactness of $Q$ the lifted potential $\widetilde{V}$ is bounded on $\widetilde{Q}$ so that the function $\widetilde{H}\circ\theta\colon\thinspace\widetilde{Q}\rightarrow\mathbb R$ is bounded from above, i.e. \[ \sup_{\widetilde{Q}}\widetilde{H}(\theta)<\infty\,. \] The following proposition is contained in \cite[Lemma 5.1]{cfp10}. \begin{prop} \label{prop:boundgivescontact} We assume the situation described in Section \ref{subsec:magflow}. Let $g$ be a metric on $M$. If $\mu^*\sigma$ has a bounded primitive $\theta$, then for all $k>\sup_{\widetilde{Q}}\widetilde{H}(\theta)$ the tuple $\big(\pi\colon\thinspace M'\rightarrow M,\alpha,\omega,g\big)$ is a virtually contact structure. The odd-dimensional symplectic form $\omega$ of the virtually contact structure is non-exact provided $\dim Q\geq3$ and the magnetic form $\sigma$ on $Q$ is not exact. On closed hyperbolic surfaces $Q$ there exist magnetic forms $\sigma$ on $Q$ for which the construction yields non-trivial virtually contact structures. \end{prop} \begin{proof} Choose $k$ such that $k>\sup_{\widetilde{Q}}\widetilde{H}(\theta)$. As in \cite[Lemma 5.1]{cfp10} we find a $\varepsilon>0$ such that \[ |\theta|_{(\tilde{h})^{\flat}}+ \varepsilon\leq \sqrt{2(k-V)} \] uniformly on $\widetilde{Q}$. Notice, that \[ \big(\tilde{\lambda}+\tilde{\tau}^*\theta\big) \big(X_{\widetilde{H}}\big)(\tilde{u})= |\tilde{u}|^2_{(\tilde{h})^{\flat}}+ (\tilde{h})^{\flat}(\tilde{u},\theta)\geq |\tilde{u}|_{(\tilde{h})^{\flat}} \Big( |\tilde{u}|_{(\tilde{h})^{\flat}}- |\theta|_{(\tilde{h})^{\flat}} \Big)\,, \] where $X_{\widetilde{H}}$ is the Hamiltonian vector field of the Hamiltonian system $(\tilde{\omega}_{\mathrm d\theta},\widetilde{H})$. Because $M'$ is the regular level set $\{\widetilde{H}=k\}$ we get $\alpha\big(X_{\widetilde{H}}\big)\geq\varepsilon^2$ on $M'$. In particular, $\alpha$ is a contact form on $M'$, see \cite[Chapter 4.3]{hoze94}. Because $(\tilde{\omega}_{\mathrm d\theta},\widetilde{H})$ is the lift of $(\omega_{\sigma},H)$ via $T^*\mu$ we obtain $T(T^*\mu)\big(X_{\widetilde{H}}\big)=X_H$. Hence, the restriction of $X_{\widetilde{H}}$ to $M'$ is bounded for any choice of metric on $M$, which by construction is a closed manifold. This implies \eqref{eq:gb2}. In order to verify \eqref{eq:gb1} we choose the metric on the total space $T^*\widetilde{Q}$ induced by the splitting into horizontal and vertical distribution with respect to the Levi--Civita connection of $\tilde{h}$. This induces a metric on $M'$ and turns $T\tilde{\tau}$ into an orthogonal projection operator, whose operator norm is bounded by $1$. Hence, $\tilde{\tau}^*\theta=\theta_{\tilde{\tau}}\circ T\tilde{\tau}$ and $\tilde{\lambda}_{\tilde{u}}=\tilde{u}\circ T\tilde{\tau}$ are uniformly bounded because $\theta$ and $\frac12|\tilde{u}|^2_{(\tilde{h})^{\flat}}= k-\widetilde{V}\big(\tilde{\tau}(\tilde{u})\big)$ are. This shows that the contact form $\alpha$ is bounded. Therefore, $\big(\pi\colon\thinspace M'\rightarrow M,\alpha,\omega,g\big)$ is a virtually contact structure. It remains to show that the virtually contact structure has a non-exact odd-dimensional symplectic form provided that $n\geq3$ and $\sigma$ is not exact. Observe that as in Remark \ref{rem:topofpi} one verifies that $M$ is an $S^{n-1}$-bundle over $Q$. The Gysin sequence yields an injection $(\tau|_M)^*$ from the second de Rham cohomology of $Q$ into the one of $M$. Hence, $\tau^*\sigma|_{TM}$ is non-exact too so that the restriction $\omega$ of the twisted symplectic form $\omega_{\sigma}$ to $TM$ is non-exact. This shows non-exactness of the symplectic form of the resulting virtually contact structures for $n\geq3$. We discuss non-triviality of the virtually contact structure for $n=2$. Only closed orientable surfaces $Q$ admit non-exact $2$-forms. By the Gysin sequence the $2$-form $\tau^*\sigma|_{TM}$ is non-exact only for the $2$-torus. The argumentation from \cite[Example 0.1.A]{gr91} shows that any primitive of $\mu^*\sigma$ on the cover $\mathbb R^2$ is unbounded and, therefore, can not result into a virtually contact structure. This excludes the case that $Q$ is a torus. By Remark \ref{rem:topofpi} we also can ignore the case $Q$ being $S^2$. For the remaining hyperbolic surfaces it was shown in \cite[Theorem B.1]{con06} that there are induced virtually contact structures $\big(\pi\colon\thinspace M'\rightarrow M,\alpha,\omega,g\big)$ that are non-trivial, cf.\ \cite[p.\ 1833, (ii)]{cfp10} and \cite[Chapter 4.3]{hoze94}. We remark that examples of contact type are constructed in \cite{gin96}. \end{proof} \begin{exwith} \label{ex:gromovsexample} Let $(Q,h)$ be a closed Riemannian manifold of negative sectional curvature and let $\sigma$ be a closed $2$-form on $Q$. Then the lift $\mu^*\sigma$ along the universal covering $\mu\colon\thinspace\widetilde{Q}\rightarrow Q$ has a bounded primitive $\theta$ on $(\widetilde{Q},\tilde{h})$, see \cite[0.2.A.]{gr91}. We remark that by the theorem of Hadamard--Cartan $\widetilde{Q}$ is diffeomorphic to $\mathbb R^n$ so that $M'=\mathbb R^n\times S^{n-1}$ and $Q$ is an aspherical manifold. By Preissmann's theorem the product $Q_1\times Q_2$ of two negatively curved manifolds does not admit a metric of negative sectional curvature. But still such a product $Q_1\times Q_2$ is aspherical and any closed $2$-form of the form $\sigma_1\oplus\sigma_2$ has a bounded primitive on the universal cover of $Q_1\times Q_2$. For more examples the reader is referred to \cite{ked09}. \end{exwith} \subsection{Somewhere contact\label{subsec:somecont}} We will use Proposition \ref{prop:boundgivescontact} for a construction of somewhere contact virtually contact structures. The main observation for that is that if the magnetic term $\sigma$ vanishes, then the restriction of $\lambda$ to $TM$ defines a contact form on $M=\{H=k\}$ for all $k>\max_QV$. Indeed, for $\varepsilon>0$ and $u\in M$ satisfying $\frac12\varepsilon^2\leq k-V\big(\tau(u)\big)$ we get \[ \lambda\big(X_H\big)(u)= |u|^2_{h^{\flat}}\geq \varepsilon^2 \] so that \cite[Chapter 4.3]{hoze94} applies. The same holds true for the Hamiltonian system that is obtained via a lift along $\mu$, or if $Q$ is replaced by a relatively compact open subset $U$ of $Q$. We consider a closed $2$-form $\sigma$ on $Q$ such that $\{\sigma=0\}$ contains a non-empty relatively compact open subset $U$. If the lift of $\sigma$ along $\mu$ has a bounded primitive $\theta$ that vanishes on $\mu^{-1}(U)$, then the resulting virtually contact structure that is described in Proposition \ref{prop:boundgivescontact} will be somewhere contact. Indeed, the restriction of the contact form \[ \alpha=\big(\tilde{\lambda}+\tilde{\tau}^*\theta\big)|_{TM'} \] to $M'\cap\big(T^*\mu\big)^{-1}(T^*U)$ equals the one of $\tilde{\lambda}|_{TM'}$, which is mapped to the contact form \[ \lambda|_{T\big(M\cap T^*U\big)} \] via $\pi=T^*\mu|_{M'}$. \begin{lem} \label{lem:boundsomcont} Let $\sigma$ be a closed $2$-form on $Q$ und $V$ be a non-empty relatively compact open subset of $Q$ such that $\sigma|_V=0$. Let $\theta$ be a bounded primitive of $\mu^*\sigma$. Then there exist an open subset $U\subset\bar{U}\subset V$ of $Q$ and a bounded primitive $\hat{\theta}$ of $\mu^*\sigma$ that coincides with $\theta$ on the complement of $\mu^{-1}(V)$ and vanishes on $\mu^{-1}(U)$ such that the virtually contact structure \[ \Big(\pi\colon\thinspace M'\rightarrow M, \alpha=\big(\tilde{\lambda}+\tilde{\tau}^*\hat{\theta}\big)|_{TM'}, \omega,g\Big) \] obtained in Proposition \ref{prop:boundgivescontact} is somewhere contact for all $k>\sup_{\widetilde{Q}}\widetilde{H}(\hat{\theta})$. The odd-dimensional symplectic form $\omega$ of the virtually contact structure is non-exact provided $\dim Q\geq3$ and the magnetic form $\sigma$ on $Q$ is not exact. \end{lem} \begin{proof} In view of the preceding remarks it is enough to show that $\mu^*\sigma$ has a bounded primitive that vanishes on $\mu^{-1}(U)$ for an open subset $U$ of $Q$. In order to do so we will assume that $\sigma$ vanishes on an embedded closed disc $D^n\cong V\subset Q$. The open set $U$ is taken to be the Euclidean ball $B_{1/2}(0)$ inside $D^n$. Additionally, we choose $V$ so small that $\mu^{-1}(V)$ decomposes into a disjoint union of subsets $V^p$ of the universal cover of $Q$ where the union is taken over all $p\in\mu^{-1}(q)$, $q\equiv0$, so that \[ \mu^p:=\mu|_{V^p}\colon\thinspace V^p\longrightarrow V \] is a diffeomorphism for all $p$. In a similar way the preimage of $U$ is decomposed into sets denoted by $U^p$. Taking the metric $\tilde{h}=\mu^*h$ on $\widetilde{Q}$ the maps $\mu^p$ are in fact isometries. Consider the given bounded primitive $\theta$ of $\mu^*\sigma$ and denote the restriction of $\theta$ to $V^p$ by $\theta^p:=\theta|_{V^p}$. Notice, that $\mathrm d\theta^p=0$ for all $p$. By the Poincar\'e--Lemma there exists a function $f^p\colon\thinspace V^p\rightarrow\mathbb R$ such that $\mathrm d f^p=\theta^p$. Choose a cut-off function $\chi$ on $Q$ that vanishes on $B_{1/2}(0)\cong U$ and is identically $1$ in a neighbourhood of $Q\setminus\Int V$. Set $\chi^p=\chi\circ\mu^p$ and \[ \hat{\theta}^p=\mathrm d(\chi^pf^p) \] and observe that $\hat{\theta}^p|_{U^p}=0$. This defines a $1$-form $\hat{\theta}$ on $\widetilde{Q}$ that is equal to $\theta$ in the complement of the $V^p$'s and coincides with $\hat{\theta}^p$ on each $V^p$. By construction $\hat{\theta}$ is a primitive of $\mu^*\sigma$ that vanishes on $\mu^{-1}(U)$. It remains to show boundedness of $\hat{\theta}$ on $(\widetilde{Q},\tilde{h})$. For this it will suffice to obtain a bound for \[ \hat{\theta}^p=f^p\mathrm d\chi^p+\chi^p\theta^p \] independently of $p$. Of course $\chi^p$ is bounded by $1$. By chain rule we have \[ \mathrm d\chi^p=\mathrm d\chi\circ T\mu^p\,. \] Because $\mu^p$ is an isometry we obtain a uniform bound on $|\mathrm d\chi^p|_{(\tilde{h})^{\flat}}$. Moreover, $|\theta^p|_{(\tilde{h})^{\flat}}$ can be estimated by the supremum of $|\theta|_{(\tilde{h})^{\flat}}$, which is bounded by assumption. Therefore, in order to obtain a uniform bound on $|\hat{\theta}^p|_{(\tilde{h})^{\flat}}$ we need a uniform bound on $|f^p|$. For this recall the Poincar\'e--Lemma. Identify $D^n\cong V$ with $V^p$ isometrically via $\mu^p$. In order to simplify the following computation in local coordinates we suppress the superscript $p$ from the notation. The $1$-form $\theta$, which got identified with $\theta^p$, is closed. Write $\theta_{\mathbf{x}}=\theta_j(\mathbf{x})\mathrm d x^j$ using summation convention for $\mathbf{x}=(x^1,\ldots,x^n)$ in $D^n$. For $t\in[0,1]$ we get $\theta_{t\mathbf{x}}(\mathbf{x})=\theta_j(t\mathbf{x})x^j$ so that a primitive of $\theta$ is given by \[ f(\mathbf{x})=\int_0^1\theta_{t\mathbf{x}}(\mathbf{x})\mathrm d t\,. \] Hence, by the mean value theorem there exists $t_0\in[0,1]$ such that \[ |f(\mathbf{x})|\leq |\theta_{t_0\mathbf{x}}(\mathbf{x})|\leq \|\theta\|_{h_{t_0\mathbf{x}}}|\mathbf{x}|_{h_{t_0\mathbf{x}}}\,. \] Observe that the operator norm $\|\theta\|_h$ equals $|\theta|_{(\tilde{h})^{\flat}}$ pointwise and is, therefore, uniformly bounded. Moreover, by compactness of $D^n$ the restriction of the metric $h$ to $D^n$ is uniformly equivalent to the Euclidean metric so that $|\mathbf{x}|_{h_{t_0\mathbf{x}}}$ admits a uniform bound. Therefore, the same holds true for $|f(\mathbf{x})|$. Consequently, the perturbed primitive $\hat{\theta}$ of $\mu^*\sigma$ is bounded. In order to finish the proof of the lemma we have to verify non-exactness of the odd-dimensional symplectic form of the resulting virtually contact structure if $\dim Q\geq3$ and $\sigma$ is non-exact. But this follows exactly as for Proposition \ref{prop:boundgivescontact}. \end{proof} \subsection{Proof of Theorem \ref{thm:mainthm}\label{subsec:pfofthm}} In view of Example \ref{ex:gromovsexample} we choose a closed Riemannian manifold $(Q,h)$ that is not simply connected. Moreover, choose a closed non-exact $2$-form $\sigma$ on $Q$ whose lift to the universal cover has a bounded primitive. By a use of a cut-off function $\chi$ as in the proof of Lemma \ref{lem:boundsomcont} we can cut-off a local primitive $\theta_V$ of $\sigma|_V$ for an embedded closed disc $V$. Setting $\sigma$ equal to $\mathrm d(\chi\theta_V)$ on $V$ this results into a new magnetic $2$-form that vanishes somewhere. Notice, that the cohomology class of $\sigma$ is unchanged and the lift of $\sigma$ still has a bounded primitive. In this situation Lemma \ref{lem:boundsomcont} yields a somewhere contact virtually contact structure $\big(\pi\colon\thinspace M'\rightarrow M,\alpha,\omega,g\big)$ with $\omega$ being non-exact if $\dim Q\geq3$ and with $M$ being not simply connected, cf.\ Remark \ref{rem:topofpi}. With these preliminaries Theorem \ref{thm:mainthm} will be a consequence of the following theorem if $n\geq3$. \begin{prop} \label{prop:mplusmandmplust} Let $\big(\pi\colon\thinspace M'\rightarrow M,\alpha,\omega,g\big)$ be a somewhere contact virtually contact structure with non-exact $\omega$ and denote by $(T,\ker\alpha_T)$ a contact manifold. Assume that $M$ and $T$ are of dimension $2n-1$. Then the connected sums $M\#M$ and $M\#T$ admit somewhere contact virtually contact structures whose odd-dimensional symplectic forms are non-exact. Moreover, if $M$ and $T$ are not simply connected, then the belt spheres of the connected sums $M\#M$ and $M\#T$ represent non-trivial elements in $\pi_{2n-2}$. \end{prop} \begin{proof} Denote by $x\in U$ the base point of $M$ where $U$ is an open subset of $M$ according to the definition of being somewhere contact, see Section \ref{subsec:definitions}. Performing a covering connected sum of $\big(\pi\colon\thinspace M'\rightarrow M,\alpha,\omega,g\big)$ with itself for any bijection $b$ of the base point fibre $\pi^{-1}(x)$ yields a virtually contact structure on $M\#M$, see Section \ref{subsec:covconsum}. In order to obtain a virtually contact structure on $M\#T$ consider the covering obtained by the disjoint union of $(T\times\{y\},\alpha_T)$, $y\in\pi^{-1}(x)$ and perform covering connected sum. Non-exactness of the odd-dimensional symplectic form of the constructed virtually contact structures follows with Lemma \ref{lem:nontrivaftercovconsum}. Further, in both cases the resulting covering contact manifold admits a contact embedding of the upper boundary of a standard symplectic $1$-handle as it is discussed in Remark \ref{rem:conthandle}. In particular, the virtually contact structures on the surged manifolds are somewhere contact. Moreover, if $M$ and $T$ both are not simply connected, then the belt sphere represents a non-trivial homotopy class in $\pi_{2n-2}$ by the proof of \cite[Proposition 3.10]{Hatcher}. \end{proof} This finishes the proof of Theorem \ref{thm:mainthm} if $n\geq3$. The reason why the above argumentation does not work for $n=2$ is that the odd-dimensional symplectic structure obtained from a twisted cotangent bundle of a surface $Q$ is necessarily exact if $Q$ is not a $2$-torus, cf.\ the discussion on the end of the proof of Proposition \ref{prop:boundgivescontact}. In order to construct non-trivial virtually contact structures in dimension $3$ that are a non-trivial connected sum we make the following observations: \begin{prop} \label{prop:pertofcontwnegcurv} Let $(M,\ker\alpha_M)$ be a closed connected contact manifold. Assume that $M$ carries a metric of negative sectional curvature and a non-exact closed $2$-form $\eta$. Then there exists a somewhere contact virtually contact structure $\big(\pi\colon\thinspace M'\rightarrow M,\alpha,\omega,g\big)$ on $M$ such that $\omega$ is cohomologous to a positive multiple of $\eta$. \end{prop} \begin{proof} By using a suitable local cut-off of $\eta$ we assume that there exists an open subset $V\subset M$ such that $\eta|_V=0$. This does not change the cohomology class of $\eta$. As explained in the proof of Lemma \ref{lem:boundsomcont} we can further assume that $\theta|_{\pi^{-1}(U)}=0$ for an open subset $U\subset\bar{U}\subset V$ of $M$. With \cite[0.2.A.]{gr91} $\pi^*\eta$ has a bounded primitive $\theta$ on the universal cover denoting by $\pi$ the corresponding covering map. For $\varepsilon>0$ sufficiently small the lift of the $2$-form $\omega=\mathrm d\alpha_M+\varepsilon\eta$ along $\pi$ has a bounded primitive $\alpha=\pi^*\alpha_M+\varepsilon\theta$ in the sense of \eqref{eq:gb1} that is a contact form. By shrinking $\varepsilon>0$ if necessary the contact form $\alpha$ satisfies \eqref{eq:gb2} as an argumentation by contradiction shows. \end{proof} Observe that $M$ is aspherical in contrast to the examples given in Proposition \ref{prop:mplusmandmplust} and that by the theorem of Hadamard--Cartan the compact manifold $M$ can not be simply connected. Examples in dimension $3$ can be obtained as follows: \begin{exwith} \label{ex:anosovthurston} Let $M$ be the mapping torus of a closed orientable surface of higher genus with monodromy diffeomorphism being pseudo-Anosov. By a theorem of Thurston \cite{thu88} $M$ is hyperbolic. Moreover, the Betti numbers $b_1=b_2$ of $M$ are non-zero so that a non-exact closed $2$-form $\eta$ can be found. By Martinet's theorem \cite[Theorem 4.1.1]{gei08} $M$ has a contact form $\alpha_M$. \end{exwith} A covering contact connected sum of the somewhere contact virtually contact manifold $M$ obtained with Example \ref{ex:anosovthurston} and Proposition \ref{prop:pertofcontwnegcurv} as described in Proposition \ref{prop:mplusmandmplust} results in a non-trivial virtually contact manifold. such that the related belt sphere represents a non-trivial class in $\pi_{2n-2}$. This finishes the proof of Theorem \ref{thm:mainthm}. \hfill Q.E.D. \subsection{Being prime\label{subsec:st*qisprim}} Recall that a closed connected manifold $M$ is called {\bf prime} if whenever written as a connected sum $M=M_1\#M_2$ one of the summands $M_1$ and $M_2$ is a homotopy sphere. The connected sum with a homotopy sphere is called to be {\bf trivial}. We remark that the virtually contact manifolds constructed in Section \ref{subsec:pfofthm} are obtained by a non-trivial connected sum and are, therefore, not prime. This follows from the corresponding belt sphere not to be contractible inside the surged manifold. The aim of the following proposition is to show that the examples of virtually contact structures given in Section \ref{subsec:pfofthm} differ from the one obtained on unit cotangent bundles $M\cong ST^*Q$ of $n$-dimensional Riemannian manifolds of negative sectional curvature studied in Section \ref{subsec:boundprim}. Recall, that by Hadamard--Cartan's theorem the universal cover of a Riemannian manofold of non-positive sectional curvature is diffeomorphic to $\mathbb R^n$. \begin{prop} The total space $ST^*Q$ of the unit cotangent bundle of a closed connected aspherical $n$-dimensional manifold $Q$ with respect to any metric on $Q$ is prime. \end{prop} \begin{proof} As $Q$ is aspherical by Whitehead's theorem the universal cover $\widetilde{Q}$ of $Q$ contracts to its base point, see \cite[Theorem 4.5]{Hatcher}. Therefore, the cotangent bundle of $\widetilde{Q}$ is trivial and $ST^*\widetilde{Q}$, which is diffeomorphic to $\widetilde{Q}\times S^{n-1}$, is homotopy equivalent to $S^{n-1}$. If $n=2$, then the universal cover of $ST^*Q$ is $\mathbb R^3$, see Remark \ref{rem:topofpi}. By Alexander's theorem $\mathbb R^3$ is {\bf irreducible}, i.e.\ any embedded $2$-sphere bounds a ball, see \cite[Theorem 1.1]{Hatcher}. With \cite[Proposition 1.6]{Hatcher} the closed $3$-manifold $ST^*Q$ itself is irreducible and, therefore, prime. If $n\geq3$, then the universal cover of $ST^*Q$ is diffeomorphic to $\widetilde{Q}\times S^{n-1}$. Consider an embedded $(2n-2)$-sphere $S_b$ in $ST^*Q$ thinking of it as the belt sphere of a connected sum decomposition of $ST^*Q$. Let $\widetilde{S}_b$ be a lift of $S_b$ to the universal cover of $ST^*Q$. Because the homology of the universal cover of $ST^*Q$ vanishes in degree $2n-2$ any lift of $S_b$ is the boundary of a bounded domain whose closure we denote by $\Omega_0$. We choose $\widetilde{S}_b$ so that $\Omega_0$ does not contain any other of the lifts of $S_b$. The closure of the unbounded component of the complement of $\widetilde{S}_b$ is denoted by $\Omega_1$. Therefore, we obtain \[ \widetilde{Q}\times S^{n-1} \cong \widetilde{ST^*Q}= \Omega_0\cup_{\widetilde{S}_b}\Omega_1 \,. \] By Seifert--van Kampen's theorem $\Omega_0$ must be simply connected. Moreover, the boundary operator of the Mayer--Vietoris sequence with respect to the above decomposition vanishes in all positive degrees. Indeed, we can take the image of $\{q\}\times S^{n-1}$, for $q\in\widetilde{Q}\simeq\{*\}$, as a generator of the homology in degree $n-1$ so that its intersection with $\Omega_0$, and hence with $\widetilde{S}_b$, is empty. Therefore, the Mayer--Vietoris sequence reduces to the following short exact sequences \[ 0\rightarrow H_k\widetilde{S}_b\rightarrow H_k\Omega_0\oplus H_k\Omega_1\rightarrow H_k\big(\widetilde{Q}\times S^{n-1}\big)\rightarrow 0 \] for all positive $k$. This implies that $\Omega_0$ has the homology of a ball. To see this for $k=n-1$ notice that the generator of the homology in degree $n-1$ of the universal cover of $ST^*Q$ is chosen to be contained in $\Omega_1$. The vanishing in degree $2n-2$ follows with $\widetilde{S}_b\cong S^{2n-2}$ being the boundary of $\Omega_0$. Therefore, $\Omega_0$ is a simply connected $(2n-1)$-dimensional homology ball with boundary $S^{2n-2}$. With \cite[p.~108, Proposition A and p.~110, Proposition C]{mil65} it follows that $\Omega_0$ is diffeomorphic to a $(2n-1)$-dimensional disc. With the arguments used in the proofs of \cite[Proposition 1.6 and Proposition 3.10]{Hatcher} this yields that $S_b$ bounds a $(2n-1)$-dimensional disc in $ST^*Q$ meaning that the assumed connected sum decomposition is trivial. After all, we see that $ST^*Q$ has to be prime. \end{proof} \section{Morse potentials\label{sec:morsepot}} This section is devoted to a proof of Theorem \ref{thm:2ndthm}. \subsection{Morsification\label{subsec:morsifi}} We consider the Hamiltonian function \[ H(u)=\frac12|u|^2_{h^{\flat}}+V\big(\tau(u)\big) \] of classical mechanics on $T^*Q$, where $\tau\colon\thinspace T^*Q\rightarrow Q$ is the cotangent bundle and $(Q,h)$ is a closed oriented connected Riemannian manifold. The linearization of $H$ at a point $u\in T^*Q$ can be written as \[ T_uH=h^{\flat}\big(u,K_u(\,.\,)\big)+T_{\tau(u)}V\circ T_u\tau\,, \] where $K_u\colon\thinspace T_u(T^*Q)\rightarrow T^*_{\tau(u)}Q$ is the connection operator of $h^{\flat}$. In particular, $u$ is a critical point of $H$ if and only if $u$ is contained in the zero section $Q$ of $T^*Q$ and is a critical point of the potential $V\colon\thinspace Q\rightarrow\mathbb R$. This is of particular interest if $V$ is a Morse function what we will assume in the following. Then $H$ will be a Morse function too. This is because to the potential $V$ a positive definite quadratic form with respect to the fibre direction is added. In particular, the Morse indices of a critical point are the same for both functions $V$ and $H$. \subsection{Topology of the energy surface\label{subsec:topofensur}} We choose a Morse function $V$ on $Q$ that has a unique local maximum. We assume that the maximum of $V$ is equal to $1$ and that all critical points of index less or equal than $n-1$ have critical value smaller than $-1$. For the regular value $0$ we consider the energy surface $M=\{H=0\}$. The sublevel set $W=\{H\leq0\}$ is a CW-complex of dimension less or equal than $n-1$. In particular, $H_kW=0$ for all $k\geq n$ and $H_{n-1}W$ is torsion-free. Hence, the boundary operator of the long exact sequence of the pair $(W,M)$ induces an isomorphism $H_{n+1}(W,M)\rightarrow H_nM$. Moreover, by the universal coefficient theorem and Poincar\'e duality $H_{n-1}W$ injects into $H_{n+1}(W,M)$ naturally. In fact, the Poincar\'e duality isomorphism $H^{n-1}W\rightarrow H_{n+1}(W,M)$ can be given in terms of the Morse functions meaning that the classes in $H_{n+1}(W,M)$ can be represented by cocore discs $\{*\}\times D^{n+1}$, see \cite[Remark on p.~35/36 and Theorem 7.5]{mil65}. Therefore, the corresponding belt spheres $\{*\}\times S^n$ generate a free subgroup of $H_nM$ that is isomorphic to $H_{n-1}W$ as an application of the boundary operator shows. The {\bf negative set} $N=\{V\leq0\}\subset Q$ is a deformation retract of $W$. Hence, $H_{n-1}W$ and $H_{n-1}N$ are isomorphic. By the assumptions on the Morse function $V$ we have $N\simeq Q\setminus\{*\}$ so that $H_{n-1}N=H_{n-1}Q$. Therefore, $H_{n-1}Q$ injects into $H_nM$ whose image is freely generated by belt spheres. Denoting by $b_kQ$ the Betti numbers of $Q$ and using $b_1Q=b_{n-1}Q$ the Hurewicz homomorphism yields \[ \pi_nM\geq\mathbb Z^{b_1Q}\,. \] This verifies the claim on the $n$-th homotopy group in Theorem \ref{thm:2ndthm}. \begin{exwith} If $Q$ is a closed Riemann surface of genus $g$, then $M$ is equal to the connected sum $S^3\#(2g)\big(S^1\times S^2\big)$. \end{exwith} \subsection{Virtually contact type\label{subsec:virtcontype}} Let $\sigma$ be a $2$-form on $Q$ that vanishes on $\{V>-1\}$ and consider the twisted symplectic form $\omega_{\sigma}=\mathrm d\lambda+\tau^*\sigma$ on $T^*Q$. Let $\theta$ be a bounded primitive of $\mu^*\sigma$ denoting by $\mu\colon\thinspace\widetilde{Q}\rightarrow Q$ the universal covering. By the proof of Lemma \ref{lem:boundsomcont} we can assume that $\theta$ vanishes on $\mu^{-1}\big(\{V>-1\}\big)$. By multiplying $\sigma$ with a small positive constant we achieve that \[ \frac12|\theta|^2_{(\tilde{h})^{\flat}}<\frac12\,. \] This implies that $\widetilde{H}(\theta)$ is negative on $\mu^{-1}\big(\{V\leq-1\}\big)$. Therefore, as in the proof of Proposition \ref{prop:boundgivescontact}, \[ \big(\tilde{\lambda}+\tilde{\tau}^*\theta\big)|_{TM'} \] is a contact form on the intersection of $M'$ with $\big(T^*\mu\big)^{-1}(T^*\{V\leq-1\})$ satisfying \eqref{eq:gb1} and \eqref{eq:gb2}. Over the remaining part $U:=\{V>-1\}$ we perturb the Liouville form as follows: Choose a function $F$ on $T^*Q$ whose support is contained in $T^*U$ such that $(\lambda+\mathrm d F)(X_H)>0$ on $M\cap T^*U$, see \cite[Lemma 5.2]{cfp10} or \cite[p. 137]{sz16}. Therefore, $(\lambda+\mathrm d F)|_{TM}$ defines a contact form on $M\cap T^*U$. Consequently, \[ \alpha=\big( \tilde{\lambda}+ \tilde{\tau}^*\theta+ \mathrm d\widetilde{F}\big)|_{TM'} \] is a contact form on $M'$, where $\widetilde{F}=F\circ T^*\mu$. Observe, that $\bar{U}$ is a compact set and that the magnetic term $\sigma$ and the chosen primitive $\theta$ of the lift $\mu^*\sigma$ vanish over $\mu^{-1}(U)$. Hence, all involved differential forms are lifts of differential forms that are defined on a compact set. In other words, \eqref{eq:gb1} and \eqref{eq:gb2} are satisfied along $M'\cap T^*\big(\mu^{-1}(U)\big)$ so that $\alpha$ defines a virtually contact structure. \begin{rem} \label{mane} The Ma\~n\'e critical value of the described magnetic system equals $1$ as the maximum of $V$ is always a lower bound. \end{rem} \subsection{Exactness\label{subsec:exactness}} The resulting odd-dimensional symplectic form on $M$ is equal to $\omega=(\mathrm d\lambda+\tau^*\sigma)|_{TM}$. This form is exact precisely if $\tau^*\sigma|_{TM}$ is exact, which is the case provided that $\sigma$ restricts to an exact form on $\bar{N}$. Invoking de Rham's theorem and $N\simeq Q\setminus\{*\}$ we see that $\omega$ will be exact in dimension $2n-1=3$. If $n\geq3$ the exactness of $\tau^*\sigma|_{TM}$ is equivalent to the one of $\sigma$ on $Q$. This follows with the Gysin sequence for the unit cotangent bundle of $\{V\leq-1\}$, for which the map induced by $\tau$ is injective in degree $2$, and an extension argument for primitive $1$-forms over $U$, which is diffeomorphic to $D^n$. In other words, for $n=2$ the odd-dimensional symplectic form $\omega$ is always exact; for $n\geq3$ the odd-dimensional symplectic form $\omega$ can be chosen to be non-exact precisely if the Betti number $b_2Q$ does not vanish. \subsection{Proof of Theorem \ref{thm:2ndthm}\label{subsec:pfofthm2}} According to the construction given in Sections \ref{subsec:topofensur}, \ref{subsec:virtcontype}, and \ref{subsec:exactness} and Example \ref{ex:gromovsexample} it suffices to find oriented closed manifolds $Q$ with non-trivial Betti numbers $b_1Q$ and $b_2Q$ that allow a Riemannian metric and a closed non-exact $2$-form $\sigma$ such that the lift of $\sigma$ has a bounded primitive. In dimension $n=2$ we can take any closed oriented hyperbolic surface and any $2$-form as magnetic term. With Example \ref{ex:anosovthurston} the case $n=3$ can be treated similarly. In view of K\"unneth's formula taking products in the sense of Example \ref{ex:gromovsexample} yields higher dimensional examples. Because for any $b\in\mathbb N$ we find a manifold $Q$ with the above listed properties satisfying $b_1Q\geq b$ the claim of Theorem \ref{subsec:pfofthm2} follows. \hfill Q.E.D. \begin{rem} For $b\geq 2$ the manifold $M$ constructed in Section \ref{subsec:pfofthm2} is not diffeomorphic to a unit cotangent bundle of a closed aspherical manifold $Q$ as such a $S^{n-1}$-bundle over $Q$ has vanishing $\pi_2$ if $n=2$, $\pi_3$ equal to $\mathbb Z_2$ if $n=3$, and $\pi_n$ equal to $\mathbb Z$ if $n\geq 4$. \end{rem} \begin{ack} We would like to thank Peter Albers, Gabriele Benedetti, Youngjin Bae, Urs Frauenfelder, Stefan Friedl, Hansj\"org Geiges, Jarek K{\c{e}}dra, and Stefan Suhr. \end{ack}
{ "redpajama_set_name": "RedPajamaArXiv" }
8,552
Make travel time easy with a firm, but collapsible surface for snacks, colouring books and toys. Strap buckles child in a car seat, push chair, plane seat or even in a departure lounge ... infact anywhere where the child can sit down! A unique and innovative product for families on the go. Snack & Play Travel Tray was created out of necessity for today's children. Snack & Play Travel Tray enhances the driving experience by providing a flat, safe area for children to eat and play. Every parent knows that when children can't reach items, they become upset. Parents must stop the car, or reach behind in order to get the child the items they want. This inconvenience can cause delays, disruption, and stress. Soft, durable, 100% sturdy nylon. It buckles either around the child, car seat, push chair, etc. Unlike rigid car trays squashes up on impact. 2 Side pockets within easy reach and a 2 inch wall to stop toys, food, etc from falling off the tray. Fits most car and booster seats. Ideal for short and long trips. Use Snack & Play Travel Tray anywhere you go with your car seat, even airplanes!!! Travel tray also makes a great gift ! Foam insert collapses on impact. Padded rim keeps toys and snacks on tray. Table surface easy to wipe clean with damp cloth. Fabric contents: cover - 100% nylon filler - polyurethane foam.
{ "redpajama_set_name": "RedPajamaC4" }
3,286
Defense Contract Management Agency employees have been directly assisting in COVID-19 response efforts across the Department of Defense. Photographed (from left to right) are Aaron Economou, an operations research analyst with the agency's Portfolio Management and Business Integration Directorate; Sigmund Evans, a DCMA emergency management specialist; and Brad Renner, a program manager for the Navy and Marine Corps with the Portfolio Management and Business Integration Directorate. Economou, Evans and Renner still serve as data team liaison officers for the Joint Rapid Acquisition Cell. DCMA employees provide direct pandemic support to battle unseen threats By Elizabeth Szoke DCMA Public Affairs FORT LEE, Va., Dec. 9, 2020 — Defense Contract Management Agency team members around the world remained resilient to continue providing insight for the nation's warfighters, despite the challenges brought on by the pandemic. In addition to their normal duties, a small group of agency personnel were also asked to give a little more time and provide direct support to COVID-19 relief efforts. The agency formed a task force in late March, shortly after Under Secretary of Defense for Acquisition and Sustainment, Ellen Lord, established the Joint Rapid Acquisition Cell, previously known as the COVID-19 Joint Acquisition Task Force. The JRAC's purpose is to serve as the single-entry point to DoD acquisition enterprise and address interagency requests for acquisition assistance from organizations like the Federal Emergency Management Agency and Department of Health and Human Services. "When we first met as the DCMA support element, we had no real idea of what our tasks would be," said Brad Renner, JRAC data team liaison officer. "We did know that the lives of many Americans were at risk and that what we were about to undertake would play a role in a massive effort to mobilize our nation's healthcare resources against a foe that none of us had ever heard of, or completely understood." Renner is regularly a program manager for the Navy and Marine Corps with the Portfolio Management and Business Integration Directorate. According to the JRAC, their mission is to align with the broader DoD COVID-19 task force. Due to the nature of their mission, the JRAC needed experienced acquisition professionals to provide advice and exercise rapid contracting tasks to expedite the process of awarding contracts on behalf of HHS. "We suddenly found ourselves facing an unknown enemy as a warfighter in a healthcare battle," said Renner. "We first stood up to support the development for a common picture of supply and demand of products like ventilators, N-95 masks and screening and diagnostics items; things that most of us knew very little about. The team quickly branched out beyond the common picture and into the product lines of effort that the JRAC was supporting." The team's goal was to leverage as many DCMA personnel assets as possible to support DoD and the other federal agencies involved in the battle against COVID-19. "These volunteers have specifically helped integrate efforts across the JRAC by liaising across a large number of multi-disciplined working groups to produce a near real time supply chain common operating picture," said Sigmund Evans, a DCMA emergency management specialist and one of the JRAC data team liaison officer. "In doing so, we have gathered and analyzed a vast amount of medical equipment inventory, usage and demand signal data enabling the JRAC director to make Defense Production Act recommendations to U.S. Cabinet-level personnel." The volunteers in the task force have made adjustments to support mission requirements. These include longer hours and weekend work, which was more prominent during the first several weeks. Volunteers indicated they had to adjust their daily mindset to the ever-changing mission requirements, which included a significant change in work-life balance. "As things have progressed, we have not had to work as many weekends. Ideally, each member would no longer need to work outside of their normal 40 hours a week," said Evans. "Family and friends have been very supportive and understand the importance this task force is doing to battle the virus. Furthermore, each member's supervisors and co-workers have been extremely supportive, often taking on additional work to ensure the main agency objectives are still met." "I think I can speak for all of us who were given the opportunity to represent our entire DCMA team in its support of this effort," said Renner. "Requests were made of DCMA, questions were asked within DCMA and support was provided by DCMA. Ultimately, the product needed to save lives was delivered to our frontline healthcare providers and our fellow citizens. We, the DCMA Data Integration Cell, are all very proud to have been selected to represent the entire DCMA team as we came together for this fight to do what we do best: deliver global acquisition insight that matters." In addition to Evans and Renner, Aaron Economou, an operations research analyst with the agency's Portfolio Management and Business Integration Directorate, is another one of the last members left on the JRAC still focusing on their COVID response mission. Other agency employees who have worked on the JRAC this year include Dave Harper, Don Miller, Jason McNutt, Brad Renner, Sig Evans, Army Col. Wyeth Anderson, Air Force Capt. Steve Terrill, and Air Force Capt. Aaron Redfield. AIMO transitions from CMO to OU Communicating during a crisis My DCMA: Ebony Barnes, Air Force portfolio manager, COVID Response Task Force volunteer COVID Joint Acquisition Task Force federal emergency management agency Department of Health and Human Services Acquisition and Sustainment Defense Production Act pandemic response DCMA leaders receive COVID-19 vaccinations 2 days ago Karkainen's 51 years of service — Priceless 4 days ago My DCMA: Peter Beville, protocol specialist 6 days ago Quick action saves life 13 days ago My DCMA: Pamela Blakely, management analyst 20 days ago
{ "redpajama_set_name": "RedPajamaCommonCrawl" }
4,872
Maltosa is een Belgisch bier. Het bier wordt gebrouwen door Brouwerij Haacht te Boortmeerbeek. Het is een donker alcoholarm bier met een alcoholpercentage van 1,2% en is verkrijgbaar in flessen van 33 en 75cl. Zie ook Lijst van Belgische bieren Lijst van Belgische brouwerijen Lijst van Belgische bierfirma's Belgische biercultuur Externe links Website brouwerij Belgisch alcoholarm bier Belgisch tafelbier
{ "redpajama_set_name": "RedPajamaWikipedia" }
7,388
Milan Derby: Who's Your Money On? In recent years, nothing much has occurred to Italian football without Juventus playing a major role. The Old Lady has dominated the league in more ways than one in the past decade. They may not have had as much success in the cup competitions. However, they've brushed all aside in the Serie A. So it is understandable that if the game is not about Juventus, it doesn't get that much attention. However, Juventus seem to have wrapped up the league title, again. All that's left to anticipate in Italian football now is the battle for top four and of course the race to avoid relegation. Napoli, in second place, seems assured of a top four finish. The two remaining slots will be keenly contested by as many as five teams – AC Milan, AS Roma, Atalanta, Inter Milan and Torino. Lazio is also not too far behind, with 42 points and placed eighth on the table. With 11 games still to go in the league, anything can still happen. The top four at the end of the season will be largely decided by those major games, the derbies where anything can happen. And one of such games will be played this weekend, between AC Milan and Inter Milan. Which side will win the second Milan derby of the season? The derby della madonnina has always been fierce, regardless of what was at stake. But it's largely expected to be more competitive this time around because of what's up for grabs. AC Milan, with 51 points, currently occupies the third position on the log table. They're closely followed in fourth by Inter Milan, with 50 points. A win for either side will send the winner even closer to second-place Napoli. They can even dream of finishing ahead of Napoli on the log table. Three of the last six Milan derbies produced over 3,5 goals. How many goals do you think will be scored in this game? For AC Milan, they will be heavily reliant on Krzysztof Piatek. The Polish striker has scored eight goals in his nine appearances for AC Milan. The battle for a Champions League spot will take a new dimension should AC Milan continue their fine form: five straight league victories and conceding just two goals in that run. For Inter Milan, their recent form is something to be worried about. They've only won once since the turn of the month, despite playing five games. Two draws and two losses mean they have plenty of work on their hands to get anything from this game. But they can look at their history against AC Milan and smile. AC Milan has not won a Milan derby since 2016. In the six games played since then between both sides, Inter Milan has won twice, with the remaining ending in draws. Which of these two sides do you think will win on Sunday? Will it end in a stalemate without goals? Leave us your comments and share your thoughts with us.
{ "redpajama_set_name": "RedPajamaCommonCrawl" }
3,015
Just Cause é uma série de videojogos de acção-aventura criada pela Avalanche Studios. São jogados em mundo aberto, arquipélagos fictícios de ambientes tropicais baseados em localizações reais incluindo as Caraíbas, a America do Sul, o Sudeste Asiático e o Mediterrâneo. A série Just Cause é particularmente conhecida por se focar no caos e nas físicas exageradas, dando grande ênfase aos ideais de liberdade, em que em todos os jogos existem várias facções que desejam ter o controlo de uma pequena nação, subjugada por um líder poderoso. Os jogadores controlam Rico Rodriguez, descrito pelos criadores como sendo "o filho de mil livros de banda desenhada e de filmes de acção. Ele é James Bond, Mad Max, Jason Bourne, El Mariachi, Wolverine, Punisher, Rambo, Tony Montana, Han Solo e Vincent Vega todos juntos numa só pessoa. E no topo... um toque de Enrique Iglesias!". O nome da série foi inspirado na Invasão do Panamá pelos Estados Unidos em 1989, que tinha o nome de código "Operation Just Cause". Jogos {| class="wikitable" ! rowspan="2" | Ano ! rowspan="2" | Titulo ! colspan="11" | Plataforma(s) |- ! style="width:3em; font-size:90%" | PS2 ! style="width:3em; font-size:90%" | PS3 ! style="width:3em; font-size:90%" | PS4 ! style="width:3em; font-size:90%" | Win ! style="width:3em; font-size:90%" | XBOX ! style="width:3em; font-size:90%" | X360 ! style="width:3em; font-size:90%" | XONE |- | 2006 | Just Cause | | | | | | | |- | 2010 | Just Cause 2 | | | | | | | | |- | 2015 | Just Cause 3 | | | | | | | |- |2018 |Just Cause 4 | | | | | | | |- Recepção Ligações externas Página oficial Just Cause Séries de jogos eletrônicos
{ "redpajama_set_name": "RedPajamaWikipedia" }
8,448
{"url":"https:\/\/www.gradesaver.com\/textbooks\/math\/other-math\/CLONE-547b8018-14a8-4d02-afd6-6bc35a0864ed\/chapter-4-decimals-summary-exercises-adding-subtracting-and-multiplying-decimal-numbers-page-297\/29","text":"## Basic College Mathematics (10th Edition)\n\nThe perimeter is the sum of the lengths of the sides. $0.75+0.75+0.875+0.875$ = $1.50+1.75$ = 3.25 The area is the length multiplied by the width. $(0.75)(0.875)$ = 0.65625 $0.65625 \\approx 0.66$","date":"2022-06-30 10:06:42","metadata":"{\"extraction_info\": {\"found_math\": true, \"script_math_tex\": 0, \"script_math_asciimath\": 0, \"math_annotations\": 0, \"math_alttext\": 0, \"mathml\": 0, \"mathjax_tag\": 0, \"mathjax_inline_tex\": 1, \"mathjax_display_tex\": 0, \"mathjax_asciimath\": 0, \"img_math\": 0, \"codecogs_latex\": 0, \"wp_latex\": 0, \"mimetex.cgi\": 0, \"\/images\/math\/codecogs\": 0, \"mathtex.cgi\": 0, \"katex\": 0, \"math-container\": 0, \"wp-katex-eq\": 0, \"align\": 0, \"equation\": 0, \"x-ck12\": 0, \"texerror\": 0, \"math_score\": 0.6211307048797607, \"perplexity\": 396.3548431232618}, \"config\": {\"markdown_headings\": true, \"markdown_code\": true, \"boilerplate_config\": {\"ratio_threshold\": 0.18, \"absolute_threshold\": 10, \"end_threshold\": 15, \"enable\": true}, \"remove_buttons\": true, \"remove_image_figures\": true, \"remove_link_clusters\": true, \"table_config\": {\"min_rows\": 2, \"min_cols\": 3, \"format\": \"plain\"}, \"remove_chinese\": true, \"remove_edit_buttons\": true, \"extract_latex\": true}, \"warc_path\": \"s3:\/\/commoncrawl\/crawl-data\/CC-MAIN-2022-27\/segments\/1656103671290.43\/warc\/CC-MAIN-20220630092604-20220630122604-00484.warc.gz\"}"}
null
null
Transcribed from the 1891 Cassell & Company edition by David Price, email ccx074@pglaf.org CASSELL'S NATIONAL LIBRARY * * * * * THE ANGEL IN THE HOUSE. * * * * * BY COVENTRY PATMORE. * * * * * "Par la grace infinie, Dieu les mist au monde ensemble." _Rousier des Dames_. [Picture: Decorative graphic] CASSELL & COMPANY, LIMITED: _LONDON, PARIS & MELBOURNE_. 1891. * * * * * THIS POEM IS INSCRIBED TO THE MEMORY OF HER BY WHOM AND FOR WHOM I BECAME A POET. * * * * * INTRODUCTION. THERE could be but one answer to the suggestion of Mr. Coventry Patmore that his "Angel in the House" might usefully have a place in this "National Library." The suggestion was made with the belief that wide and cheap diffusion would not take from the value of a copyright library edition, while the best use of writing is fulfilled by the spreading of verse dedicated to the sacred love of home. The two parts of the Poem appeared in 1854 and 1856, were afterwards elaborately revised, and have since obtained a permanent place among the Home Books of the English People. Our readers will join, surely, in thanks to the author for the present he has made us. H. M. CONTENTS BOOK I. PAGE THE PROLOGUE. 13 CANTO I. THE CATHEDRAL CLOSE 17 Preludes: 1. The Impossibility 17 2. Love's Really 17 3. The Poet's Confidence 18 The Cathedral Close 19 II. MARY AND MILDRED 24 Preludes: 1. The Paragon 24 2. Love at Large 26 3. Love and Duty 27 4. A Distinction 28 Mary and Mildred 28 III. HONORIA 32 Preludes: 1. The Lover 32 2. Love a Virtue 34 3. The Attainment 34 Honoria 35 IV. THE MORNING CALL 39 Preludes: 1. The Rose of the World 39 2. The Tribute 41 3. Compensation 42 The Morning Call 42 V. THE VIOLETS 46 Preludes: 1. The Comparison 46 2. Love in Tears 48 3. Prospective Faith 48 4. Venus Victrix 49 The Violets 49 VI. THE DEAN 53 Preludes: 1. Perfect Love rare 53 2. Love Justified 54 3. Love Serviceable 55 4. A Riddle Solved 56 The Dean 56 VII. ÆTNA AND THE MOON 60 Preludes: 1. Love's Immortality 60 2. Heaven and Earth 61 Ætna and the Moon 62 VIII. SARUM PLAIN 66 Preludes: 1. Life of Life 66 2. The Revelation 67 3. The Spirit's Epochs 67 4. The Prototype 68 5. The Praise of Love 68 Sarum Plain 69 IX. SAHARA 74 Preludes: 1. The Wife's Tragedy 74 2. Common Graces 75 3. The Zest of Life 76 4. Fool and Wise 76 Sahara 77 X. CHURCH TO CHURCH 81 Preludes: 1. The Joyful Wisdom 81 2. The Devices 84 Going to Church 84 XI. THE DANCE 89 Preludes: 1. The Daughter of Eve 89 2. Aurea Dicta 91 The Dance 93 XII. THE ABDICATION 97 Preludes: 1. The Chace 97 2. Denied 100 3. The Churl 101 The Abdication 102 BOOK II. THE PROLOGUE 105 I. ACCEPTED 109 Preludes: 1. The Song of Songs 109 2. The Kites 110 3. Orpheus 111 4. Nearest the Dearest 111 5. Perspective 112 Accepted 112 II. THE COURSE OF TRUE LOVE 116 Preludes: 1. The Changed Allegiance 116 2. Beauty 120 3. Lais and Lucretia 120 The Course of True Love 121 III. THE COUNTRY BALL 126 Preludes: 1. Love Ceremonious 126 2. The Rainbow 127 3. A Paradox 127 The County Ball 128 IV. LOVE IN IDLENESS 132 Preludes: 1. Honour and Desert 132 2. Love and Honour 133 3. Valour Misdirected 134 Love in Idleness 134 V. THE QUEEN'S ROOM 139 Preludes: 1. Rejected 139 2. Rachel 140 3. The Heart's Prophecies 141 The Queen's Room 141 VI. THE LOVE-LETTERS 145 Preludes: 1. Love's Perversity 145 2. The Power of Love 147 The Love-Letters 148 VII. THE REVULSION 152 Preludes: 1. Joy and Use 152 2. 'She was Mine' 153 The Revulsion 153 VIII. THE KOH-I-NOOR 158 Preludes: 1. In Love 158 2. Love Thinking 160 3. The Kiss 161 The Koh-i-noor 161 IX. THE FRIENDS 165 Preludes: 1. The Nursling of Civility 165 2. The Foreign Land 166 3. Disappointment 166 The Friends 167 X. THE EPITAPH 170 Preludes: 1. Frost in Harvest 170 2. Felicity 171 3. Marriage Indissoluble 172 The Epitaph 172 XI. THE WEDDING 176 Preludes: 1. Platonic Love 176 2. A Demonstration 177 3. The Symbol 178 4. Constancy Rewarded 178 The Wedding 179 XII. HUSBAND AND WIFE 183 Preludes: 1. The Married Lover 183 2. The Amaranth 184 Husband and Wife 185 The Epilogue 189 Book I. THE PROLOGUE. 1 'MINE is no horse with wings, to gain The region of the spheral chime; He does but drag a rumbling wain, Cheer'd by the coupled bells of rhyme; And if at Fame's bewitching note My homely Pegasus pricks an ear, The world's cart-collar hugs his throat, And he's too wise to prance or rear.' 2 Thus ever answer'd Vaughan his Wife, Who, more than he, desired his fame; But, in his heart, his thoughts were rife How for her sake to earn a name. With bays poetic three times crown'd, And other college honours won, He, if he chose, might be renown'd, He had but little doubt, she none; And in a loftier phrase he talk'd With her, upon their Wedding-Day, (The eighth), while through the fields they walk'd, Their children shouting by the way. 3 'Not careless of the gift of song, Nor out of love with noble fame, I, meditating much and long What I should sing, how win a name, Considering well what theme unsung, What reason worth the cost of rhyme, Remains to loose the poet's tongue In these last days, the dregs of time, Learn that to me, though born so late, There does, beyond desert, befall (May my great fortune make me great!) The first of themes, sung last of all. In green and undiscover'd ground, Yet near where many others sing, I have the very well-head found Whence gushes the Pierian Spring.' 4 Then she: 'What is it, Dear? The Life Of Arthur, or Jerusalem's Fall?' 'Neither: your gentle self, my Wife, And love, that grows from one to all. And if I faithfully proclaim Of these the exceeding worthiness, Surely the sweetest wreath of Fame Shall, to your hope, my brows caress; And if, by virtue of my choice Of this, the most heart-touching theme That ever tuned a poet's voice, I live, as I am bold to dream, To be delight to many days, And into silence only cease When those are still, who shared their bays With Laura and with Beatrice, Imagine, Love, how learned men Will deep-conceiv'd devices find, Beyond my purpose and my ken, An ancient bard of simple mind. You, Sweet, his Mistress, Wife, and Muse, Were you for mortal woman meant? Your praises give a hundred clues To mythological intent! And, severing thus the truth from trope, In you the Commentators see Outlines occult of abstract scope, A future for philosophy! Your arm's on mine! these are the meads In which we pass our living days; There Avon runs, now hid with reeds, Now brightly brimming pebbly bays; Those are our children's songs that come With bells and bleatings of the sheep; And there, in yonder English home, We thrive on mortal food and sleep!' She laugh'd. How proud she always was To feel how proud he was of her! But he had grown distraught, because The Muse's mood began to stir. 5 His purpose with performance crown'd, He to his well-pleased Wife rehears'd, When next their Wedding-Day came round, His leisure's labour, 'Book the First.' CANTO I The Cathedral Close. PRELUDES. I. _The Impossibility_. Lo, love's obey'd by all. 'Tis right That all should know what they obey, Lest erring conscience damp delight, And folly laugh our joys away. Thou Primal Love, who grantest wings And voices to the woodland birds, Grant me the power of saying things Too simple and too sweet for words! II. _Love's Really_. I walk, I trust, with open eyes; I've travell'd half my worldly course; And in the way behind me lies Much vanity and some remorse; I've lived to feel how pride may part Spirits, tho' match'd like hand and glove; I've blush'd for love's abode, the heart; But have not disbelieved in love; Nor unto love, sole mortal thing Of worth immortal, done the wrong To count it, with the rest that sing, Unworthy of a serious song; And love is my reward; for now, When most of dead'ning time complain, The myrtle blooms upon my brow, Its odour quickens all my brain. III. _The Poet's Confidence_. The richest realm of all the earth Is counted still a heathen land: Lo, I, like Joshua, now go forth To give it into Israel's hand. I will not hearken blame or praise; For so should I dishonour do To that sweet Power by which these Lays Alone are lovely, good, and true; Nor credence to the world's cries give, Which ever preach and still prevent Pure passion's high prerogative To make, not follow, precedent. From love's abysmal ether rare If I to men have here made known New truths, they, like new stars, were there Before, though not yet written down. Moving but as the feelings move, I run, or loiter with delight, Or pause to mark where gentle Love Persuades the soul from height to height. Yet, know ye, though my words are gay As David's dance, which Michal scorn'd. If kindly you receive the Lay, You shall be sweetly help'd and warn'd. THE CATHEDRAL CLOSE. 1 Once more I came to Sarum Close, With joy half memory, half desire, And breathed the sunny wind that rose And blew the shadows o'er the Spire, And toss'd the lilac's scented plumes, And sway'd the chestnut's thousand cones, And fill'd my nostrils with perfumes, And shaped the clouds in waifs and zones, And wafted down the serious strain Of Sarum bells, when, true to time, I reach'd the Dean's, with heart and brain That trembled to the trembling chime. 2 'Twas half my home, six years ago. The six years had not alter'd it: Red-brick and ashlar, long and low, With dormers and with oriels lit. Geranium, lychnis, rose array'd The windows, all wide open thrown; And some one in the Study play'd The Wedding-March of Mendelssohn. And there it was I last took leave: 'Twas Christmas: I remember'd now The cruel girls, who feign'd to grieve, Took down the evergreens; and how The holly into blazes woke The fire, lighting the large, low room, A dim, rich lustre of old oak And crimson velvet's glowing gloom. No change had touch'd Dean Churchill: kind, By widowhood more than winters bent, And settled in a cheerful mind, As still forecasting heaven's content. Well might his thoughts be fix'd on high, Now she was there! Within her face Humility and dignity Were met in a most sweet embrace. She seem'd expressly sent below To teach our erring minds to see The rhythmic change of time's swift flow As part of still eternity. Her life, all honour, observed, with awe Which cross experience could not mar, The fiction of the Christian law That all men honourable are; And so her smile at once conferr'd High flattery and benign reproof; And I, a rude boy, strangely stirr'd, Grew courtly in my own behoof. The years, so far from doing her wrong, Anointed her with gracious balm, And made her brows more and more young With wreaths of amaranth and palm. 4 Was this her eldest, Honor; prude, Who would not let me pull the swing; Who, kiss'd at Christmas, call'd me rude, And, sobbing low, refused to sing? How changed! In shape no slender Grace, But Venus; milder than the dove; Her mother's air; her Norman face; Her large sweet eyes, clear lakes of love. Mary I knew. In former time Ailing and pale, she thought that bliss Was only for a better clime, And, heavenly overmuch, scorn'd this. I, rash with theories of the right, Which stretch'd the tether of my Creed, But did not break it, held delight Half discipline. We disagreed. She told the Dean I wanted grace. Now she was kindest of the three, And soft wild roses deck'd her face. And, what, was this my Mildred, she To herself and all a sweet surprise? My Pet, who romp'd and roll'd a hoop? I wonder'd where those daisy eyes Had found their touching curve and droop. 5 Unmannerly times! But now we sat Stranger than strangers; till I caught And answer'd Mildred's smile; and that Spread to the rest, and freedom brought. The Dean talk'd little, looking on, Of three such daughters justly vain. What letters they had had from Bonn, Said Mildred, and what plums from Spain! By Honor I was kindly task'd To excuse my never coming down From Cambridge; Mary smiled and ask'd Were Kant and Goethe yet outgrown? And, pleased, we talk'd the old days o'er; And, parting, I for pleasure sigh'd. To be there as a friend, (since more), Seem'd then, seems still, excuse for pride; For something that abode endued With temple-like repose, an air Of life's kind purposes pursued With order'd freedom sweet and fair. A tent pitch'd in a world not right It seem'd, whose inmates, every one, On tranquil faces bore the light Of duties beautifully done, And humbly, though they had few peers, Kept their own laws, which seem'd to be The fair sum of six thousand years' Traditions of civility. CANTO II. Mary And Mildred. PRELUDES. I. _The Paragon_. WHEN I behold the skies aloft Passing the pageantry of dreams, The cloud whose bosom, cygnet-soft, A couch for nuptial Juno seems, The ocean broad, the mountains bright, The shadowy vales with feeding herds, I from my lyre the music smite, Nor want for justly matching words. All forces of the sea and air, All interests of hill and plain, I so can sing, in seasons fair, That who hath felt may feel again. Elated oft by such free songs, I think with utterance free to raise That hymn for which the whole world longs, A worthy hymn in woman's praise; A hymn bright-noted like a bird's, Arousing these song-sleepy times With rhapsodies of perfect words, Ruled by returning kiss of rhymes. But when I look on her and hope To tell with joy what I admire, My thoughts lie cramp'd in narrow scope, Or in the feeble birth expire; No mystery of well-woven speech, No simplest phrase of tenderest fall, No liken'd excellence can reach Her, thee most excellent of all, The best half of creation's best, Its heart to feel, its eye to see, The crown and complex of the rest, Its aim and its epitome. Nay, might I utter my conceit, 'Twere after all a vulgar song, For she's so simply, subtly sweet, My deepest rapture does her wrong. Yet is it now my chosen task To sing her worth as Maid and Wife; Nor happier post than this I ask, To live her laureate all my life. On wings of love uplifted free, And by her gentleness made great, I'll teach how noble man should be To match with such a lovely mate; And then in her may move the more The woman's wish to be desired, (By praise increased), till both shall soar, With blissful emulations fired. And, as geranium, pink, or rose Is thrice itself through power of art, So may my happy skill disclose New fairness even in her fair heart; Until that churl shall nowhere be Who bends not, awed, before the throne Of her affecting majesty, So meek, so far unlike our own; Until (for who may hope too much From her who wields the powers of love?) Our lifted lives at last shall touch That happy goal to which they move; Until we find, as darkness rolls Away, and evil mists dissolve, That nuptial contrasts are the poles On which the heavenly spheres revolve. II. _Love at Large_. Whene'er I come where ladies are, How sad soever I was before, Though like a ship frost-bound and far Withheld in ice from the ocean's roar, Third-winter'd in that dreadful dock, With stiffen'd cordage, sails decay'd, And crew that care for calm and shock Alike, too dull to be dismay'd, Yet, if I come where ladies are, How sad soever I was before, Then is my sadness banish'd far, And I am like that ship no more; Or like that ship if the ice-field splits, Burst by the sudden polar Spring, And all thank God with their warming wits, And kiss each other and dance and sing, And hoist fresh sails, that make the breeze Blow them along the liquid sea, Out of the North, where life did freeze, Into the haven where they would be. III. _Love and Duty_. Anne lived so truly from above, She was so gentle and so good, That duty bade me fall in love, And 'but for that,' thought I, 'I should!' I worshipp'd Kate with all my will, In idle moods you seem to see A noble spirit in a hill, A human touch about a tree. IV. _A Distinction_. The lack of lovely pride, in her Who strives to please, my pleasure numbs, And still the maid I most prefer Whose care to please with pleasing comes. MARY AND MILDRED. 1 One morning, after Church, I walk'd Alone with Mary on the lawn, And felt myself, howe'er we talk'd, To grave themes delicately drawn. When she, delighted, found I knew More of her peace than she supposed, Our confidences heavenwards grew, Like fox-glove buds, in pairs disclosed. Our former faults did we confess, Our ancient feud was more than heal'd, And, with the woman's eagerness For amity full-sign'd and seal'd, She, offering up for sacrifice Her heart's reserve, brought out to show Some verses, made when she was ice To all but Heaven, six years ago; Since happier grown! I took and read The neat-writ lines. She, void of guile, Too late repenting, blush'd, and said, I must not think about the style. 2 'Day after day, until to-day, Imaged the others gone before, The same dull task, the weary way, The weakness pardon'd o'er and o'er, 'The thwarted thirst, too faintly felt, For joy's well-nigh forgotten life, The restless heart, which, when I knelt, Made of my worship barren strife. 'Ah, whence to-day's so sweet release, This clearance light of all my care, This conscience free, this fertile peace, These softly folded wings of prayer, 'This calm and more than conquering love, With which nought evil dares to cope, This joy that lifts no glance above, For faith too sure, too sweet for hope? 'O, happy time, too happy change, It will not live, though fondly nurst! Full soon the sun will seem as strange As now the cloud which seems dispersed.' 3 She from a rose-tree shook the blight; And well she knew that I knew well Her grace with silence to requite; And, answering now the luncheon bell, I laugh'd at Mildred's laugh, which made All melancholy wrong, its mood Such sweet self-confidence display'd, So glad a sense of present good. 4 I laugh'd and sigh'd: for I confess I never went to Ball, or Fête, Or Show, but in pursuit express Of my predestinated mate; And thus to me, who had in sight The happy chance upon the cards, Each beauty blossom'd in the light Of tender personal regards; And, in the records of my breast, Red-letter'd, eminently fair, Stood sixteen, who, beyond the rest, By turns till then had been my care: At Berlin three, one at St. Cloud, At Chatteris, near Cambridge, one, At Ely four, in London two, Two at Bowness, in Paris none, And, last and best, in Sarum three; But dearest of the whole fair troop, In judgment of the moment, she Whose daisy eyes had learn'd to droop. Her very faults my fancy fired; My loving will, so thwarted, grew; And, bent on worship, I admired Whate'er she was, with partial view. And yet when, as to-day, her smile Was prettiest, I could not but note Honoria, less admired the while, Was lovelier, though from love remote. CANTO III. Honoria PRELUDES. I. _The Lover_. HE meets, by heavenly chance express, The destined maid; some hidden hand Unveils to him that loveliness Which others cannot understand. His merits in her presence grow, To match the promise in her eyes, And round her happy footsteps blow The authentic airs of Paradise. For joy of her he cannot sleep; Her beauty haunts him all the night; It melts his heart, it makes him weep For wonder, worship, and delight. O, paradox of love, he longs, Most humble when he most aspires, To suffer scorn and cruel wrongs From her he honours and desires. Her graces make him rich, and ask No guerdon; this imperial style Affronts him; he disdains to bask, The pensioner of her priceless smile. He prays for some hard thing to do, Some work of fame and labour immense, To stretch the languid bulk and thew Of love's fresh-born magnipotence. No smallest boon were bought too dear, Though barter'd for his love-sick life; Yet trusts he, with undaunted cheer, To vanquish heaven, and call her Wife He notes how queens of sweetness still Neglect their crowns, and stoop to mate; How, self-consign'd with lavish will, They ask but love proportionate; How swift pursuit by small degrees, Love's tactic, works like miracle; How valour, clothed in courtesies, Brings down the haughtiest citadel; And therefore, though he merits not To kiss the braid upon her skirt, His hope, discouraged ne'er a jot, Out-soars all possible desert. II. _Love a Virtue_. Strong passions mean weak will, and he Who truly knows the strength and bliss Which are in love, will own with me No passion but a virtue 'tis. Few hear my word; it soars above The subtlest senses of the swarm Of wretched things which know not love, Their Psyche still a wingless worm. Ice-cold seems heaven's noble glow To spirits whose vital heat is hell; And to corrupt hearts even so The songs I sing, the tale I tell. These cannot see the robes of white In which I sing of love. Alack, But darkness shows in heavenly light, Though whiteness, in the dark, is black! III. _The Attainment_. You love? That's high as you shall go; For 'tis as true as Gospel text, Not noble then is never so, Either in this world or the next. HONORIA. 1 Grown weary with a week's exile From those fair friends, I rode to see The church-restorings; lounged awhile, And met the Dean; was ask'd to tea, And found their cousin, Frederick Graham At Honor's side. Was I concern'd, If, when she sang, his colour came, That mine, as with a buffet, burn'd? A man to please a girl! thought I, Retorting his forced smiles, the shrouds Of wrath, so hid as she was by, Sweet moon between her lighted clouds! 2 Whether this Cousin was the cause I know not, but I seem'd to see, The first time then, how fair she was, How much the fairest of the three. Each stopp'd to let the other go; But, time-bound, he arose the first. Stay'd he in Sarum long? If so I hoped to see him at the Hurst. No: he had call'd here, on his way To Portsmouth, where the Arrogant, His ship, was; he should leave next day, For two years' cruise in the Levant. 3 Had love in her yet struck its germs? I watch'd. Her farewell show'd me plain She loved, on the majestic terms That she should not be loved again; And so her cousin, parting, felt. Hope in his voice and eye was dead. Compassion did my malice melt; Then went I home to a restless bed. I, who admired her too, could see His infinite remorse at this Great mystery, that she should be So beautiful, yet not be his, And, pitying, long'd to plead his part; But scarce could tell, so strange my whim, Whether the weight upon my heart Was sorrow for myself or him. 4 She was all mildness; yet 'twas writ In all her grace, most legibly, 'He that's for heaven itself unfit, Let him not hope to merit me.' And such a challenge, quite apart From thoughts of love, humbled, and thus To sweet repentance moved my heart, And made me more magnanimous, And led me to review my life, Inquiring where in aught the least, If question were of her for wife, Ill might be mended, hope increas'd. Not that I soar'd so far above Myself, as this great hope to dare; And yet I well foresaw that love Might hope where reason must despair; And, half-resenting the sweet pride Which would not ask me to admire, 'Oh,' to my secret heart I sigh'd, 'That I were worthy to desire!' 5 As drowsiness my brain reliev'd, A shrill defiance of all to arms, Shriek'd by the stable-cock, receiv'd An angry answer from three farms. And, then, I dream'd that I, her knight, A clarion's haughty pathos heard, And rode securely to the fight, Cased in the scarf she had conferr'd; And there, the bristling lists behind, Saw many, and vanquish'd all I saw Of her unnumber'd cousin-kind, In Navy, Army, Church, and Law; Smitten, the warriors somehow turn'd To Sarum choristers, whose song, Mix'd with celestial sorrow, yearn'd With joy no memory can prolong; And phantasms as absurd and sweet Merged each in each in endless chace, And everywhere I seem'd to meet The haunting fairness of her face. CANTO IV. The Morning Call. PRELUDES. I. _The Rose of the World_. LO, when the Lord made North and South And sun and moon ordained, He, Forthbringing each by word of mouth In order of its dignity, Did man from the crude clay express By sequence, and, all else decreed, He form'd the woman; nor might less Than Sabbath such a work succeed. And still with favour singled out, Marr'd less than man by mortal fall, Her disposition is devout, Her countenance angelical; The best things that the best believe Are in her face so kindly writ The faithless, seeing her, conceive Not only heaven, but hope of it; No idle thought her instinct shrouds, But fancy chequers settled sense, Like alteration of the clouds On noonday's azure permanence; Pure dignity, composure, ease Declare affections nobly fix'd, And impulse sprung from due degrees Of sense and spirit sweetly mix'd. Her modesty, her chiefest grace, The cestus clasping Venus' side, How potent to deject the face Of him who would affront its pride! Wrong dares not in her presence speak, Nor spotted thought its taint disclose Under the protest of a cheek Outbragging Nature's boast the rose. In mind and manners how discreet; How artless in her very art; How candid in discourse; how sweet The concord of her lips and heart; How simple and how circumspect; How subtle and how fancy-free; Though sacred to her love, how deck'd With unexclusive courtesy; How quick in talk to see from far The way to vanquish or evade; How able her persuasions are To prove, her reasons to persuade; How (not to call true instinct's bent And woman's very nature, harm), How amiable and innocent Her pleasure in her power to charm; How humbly careful to attract, Though crown'd with all the soul desires, Connubial aptitude exact, Diversity that never tires. II. _The Tribute_. Boon Nature to the woman bows; She walks in earth's whole glory clad, And, chiefest far herself of shows, All others help her, and are glad: No splendour 'neath the sky's proud dome But serves for her familiar wear; The far-fetch'd diamond finds its home Flashing and smouldering in her hair; For her the seas their pearls reveal; Art and strange lands her pomp supply With purple, chrome, and cochineal, Ochre, and lapis lazuli; The worm its golden woof presents; Whatever runs, flies, dives, or delves, All doff for her their ornaments, Which suit her better than themselves; And all, by this their power to give, Proving her right to take, proclaim Her beauty's clear prerogative To profit so by Eden's blame. III. _Compensation_. That nothing here may want its praise, Know, she who in her dress reveals A fine and modest taste, displays More loveliness than she conceals. THE MORNING CALL. 1 'By meekness charm'd, or proud to allow A queenly claim to live admired, Full many a lady has ere now My apprehensive fancy fired, And woven many a transient chain; But never lady like to this, Who holds me as the weather-vane Is held by yonder clematis. She seems the life of nature's powers; Her beauty is the genial thought Which makes the sunshine bright; the flowers, But for their hint of her, were nought.' 2 A voice, the sweeter for the grace Of suddenness, while thus I dream'd, 'Good morning!' said or sang. Her face The mirror of the morning seem'd. Her sisters in the garden walk'd, And would I come? Across the Hall She led me; and we laugh'd and talk'd, And praised the Flower-show and the Ball; And Mildred's pinks had gain'd the Prize; And, stepping like the light-foot fawn, She brought me 'Wiltshire Butterflies,' The Prize-book; then we paced the lawn, Close-cut, and with geranium-plots, A rival glow of green and red; Than counted sixty apricots On one small tree; the gold-fish fed; And watch'd where, black with scarlet tans, Proud Psyche stood and flash'd like flame, Showing and shutting splendid fans; And in the prize we found its name. 3 The sweet hour lapsed, and left my breast A load of joy and tender care; And this delight, which life oppress'd, To fix'd aims grew, that ask'd for pray'r. I rode home slowly; whip-in-hand And soil'd bank-notes all ready, stood The Farmer who farm'd all my land, Except the little Park and Wood; And with the accustom'd compliment Of talk, and beef, and frothing beer, I, my own steward, took my rent, Three hundred pounds for half the year; Our witnesses the Cook and Groom, We sign'd the lease for seven years more, And bade Good-day; then to my room I went, and closed and lock'd the door, And cast myself down on my bed, And there, with many a blissful tear, I vow'd to love and pray'd to wed The maiden who had grown so dear; Thank'd God who had set her in my path; And promised, as I hoped to win, That I would never dim my faith By the least selfishness or sin; Whatever in her sight I'd seem I'd truly be; I'd never blend With my delight in her a dream 'Twould change her cheek to comprehend; And, if she wish'd it, I'd prefer Another's to my own success; And always seek the best for her With unofficious tenderness. 4 Rising, I breathed a brighter clime, And found myself all self above, And, with a charity sublime, Contemn'd not those who did not love: And I could not but feel that then I shone with something of her grace, And went forth to my fellow men My commendation in my face. CANTO V. The Violets. PRELUDES. I. _The Comparison_. WHERE she succeeds with cloudless brow, In common and in holy course, He fails, in spite of prayer and vow And agonies of faith and force; Or, if his suit with Heaven prevails To righteous life, his virtuous deeds Lack beauty, virtue's badge; she fails More graciously than he succeeds. Her spirit, compact of gentleness, If Heaven postpones or grants her pray'r, Conceives no pride in its success, And in its failure no despair; But his, enamour'd of its hurt, Baffled, blasphemes, or, not denied, Crows from the dunghill of desert, And wags its ugly wings for pride. He's never young nor ripe; she grows More infantine, auroral, mild, And still the more she lives and knows The lovelier she's express'd a child. Say that she wants the will of man To conquer fame, not check'd by cross, Nor moved when others bless or ban; She wants but what to have were loss. Or say she wants the patient brain To track shy truth; her facile wit At that which he hunts down with pain Flies straight, and does exactly hit. Were she but half of what she is, He twice himself, mere love alone, Her special crown, as truth is his, Gives title to the worthier throne; For love is substance, truth the form; Truth without love were less than nought; But blindest love is sweet and warm, And full of truth not shaped by thought, And therefore in herself she stands Adorn'd with undeficient grace, Her happy virtues taking hands, Each smiling in another's face. So, dancing round the Tree of Life, They make an Eden in her breast, While his, disjointed and at strife, Proud-thoughted, do not bring him rest. II. _Love in Tears_. If fate Love's dear ambition mar, And load his breast with hopeless pain, And seem to blot out sun and star, Love, won or lost, is countless gain; His sorrow boasts a secret bliss Which sorrow of itself beguiles, And Love in tears too noble is For pity, save of Love in smiles. But, looking backward through his tears, With vision of maturer scope, How often one dead joy appears The platform of some better hope! And, let us own, the sharpest smart Which human patience may endure Pays light for that which leaves the heart More generous, dignified, and pure. III. _Prospective Faith_. They safely walk in darkest ways Whose youth is lighted from above, Where, through the senses' silvery haze, Dawns the veil'd moon of nuptial love. Who is the happy husband? He Who, scanning his unwedded life, Thanks Heaven, with a conscience free, 'Twas faithful to his future wife. IV. _Venus Victrix_. Fatal in force, yet gentle in will, Defeats, from her, are tender pacts, For, like the kindly lodestone, still She's drawn herself by what she attracts. THE VIOLETS. 1 I went not to the Dean's unbid: I would not have my mystery, From her so delicately hid, The guess of gossips at their tea. A long, long week, and not once there, Had made my spirit sick and faint, And lack-love, foul as love is fair, Perverted all things to complaint. How vain the world had grown to be! How mean all people and their ways, How ignorant their sympathy, And how impertinent their praise; What they for virtuousness esteem'd, How far removed from heavenly right; What pettiness their trouble seem'd, How undelightful their delight; To my necessity how strange The sunshine and the song of birds; How dull the clouds' continual change, How foolishly content the herds; How unaccountable the law Which bade me sit in blindness here, While she, the sun by which I saw, Shed splendour in an idle sphere! And then I kiss'd her stolen glove, And sigh'd to reckon and define The modes of martyrdom in love, And how far each one might be mine. I thought how love, whose vast estate Is earth and air and sun and sea, Encounters oft the beggar's fate, Despised on score of poverty; How Heaven, inscrutable in this, Lets the gross general make or mar The destiny of love, which is So tender and particular; How nature, as unnatural And contradicting nature's source, Which is but love, seems most of all Well-pleased to harry true love's course; How, many times, it comes to pass That trifling shades of temperament, Affecting only one, alas, Not love, but love's success prevent; How manners often falsely paint The man; how passionate respect, Hid by itself, may bear the taint Of coldness and a dull neglect; And how a little outward dust Can a clear merit quite o'ercloud, And make her fatally unjust, And him desire a darker shroud; How senseless opportunity Gives baser men the better chance; How powers, adverse else, agree To cheat her in her ignorance; How Heaven its very self conspires With man and nature against love, As pleased to couple cross desires, And cross where they themselves approve. Wretched were life, if the end were now! But this gives tears to dry despair, Faith shall be blest, we know not how, And love fulfill'd, we know not where. 2 While thus I grieved, and kiss'd her glove, My man brought in her note to say, Papa had hid her send his love, And would I dine with them next day? They had learn'd and practised Purcell's glee, To sing it by to-morrow night. The Postscript was: Her sisters and she Inclosed some violets, blue and white; She and her sisters found them where I wager'd once no violets grew; So they had won the gloves. And there The violets lay, two white, one blue. CANTO VI. The Dean. PRELUDES. I. _Perfect Love rare_. MOST rare is still most noble found, Most noble still most incomplete; Sad law, which leaves King Love uncrown'd In this obscure, terrestrial seat! With bale more sweet than others' bliss, And bliss more wise than others' bale, The secrets of the world are his. And freedom without let or pale. O, zealous good, O, virtuous glee, Religious, and without alloy, O, privilege high, which none but he Who highly merits can enjoy; O, Love, who art that fabled sun Which all the world with bounty loads, Without respect of realms, save one, And gilds with double lustre Rhodes; A day of whose delicious life, Though full of terrors, full of tears, Is better than of other life A hundred thousand million years; Thy heavenly splendour magnifies The least commixture of earth's mould, Cheapens thyself in thine own eyes, And makes the foolish mocker bold. II. _Love Justified_. What if my pole-star of respect Be dim to others? Shall their 'Nay,' Presumably their own defect, Invalidate my heart's strong 'Yea'? And can they rightly me condemn, If I, with partial love, prefer? I am not more unjust to them, But only not unjust to her. Leave us alone! After awhile, This pool of private charity Shall make its continent an isle, And roll, a world-embracing sea; This foolish zeal of lip for lip, This fond, self-sanction'd, wilful zest, Is that elect relationship Which forms and sanctions all the rest; This little germ of nuptial love, Which springs so simply from the sod, The root is, as my song shall prove, Of all our love to man and God. III. _Love Serviceable_. What measure Fate to him shall mete Is not the noble Lover's care; He's heart-sick with a longing sweet To make her happy as she's fair. Oh, misery, should she him refuse, And so her dearest good mistake! His own success he thus pursues With frantic zeal for her sole sake. To lose her were his life to blight, Being loss to hers; to make her his, Except as helping her delight, He calls but incidental bliss; And holding life as so much pelf To buy her posies, learns this lore: He does not rightly love himself Who does not love another more. IV. _A Riddle Solved_. Kind souls, you wonder why, love you, When you, you wonder why, love none. We love, Fool, for the good we do, Not that which unto us is done! THE DEAN. 1 The Ladies rose. I held the door, And sigh'd, as her departing grace Assured me that she always wore A heart as happy as her face; And, jealous of the winds that blew, I dreaded, o'er the tasteless wine, What fortune momently might do To hurt the hope that she'd be mine. 2 Towards my mark the Dean's talk set: He praised my 'Notes on Abury,' Read when the Association met At Sarum; he was pleased to see I had not stopp'd, as some men had, At Wrangler and Prize Poet; last, He hoped the business was not bad I came about: then the wine pass'd. 3 A full glass prefaced my reply: I loved his daughter, Honor; I told My estate and prospects; might I try To win her? At my words so bold My sick heart sank. Then he: He gave His glad consent, if I could get Her love. A dear, good Girl! she'd have Only three thousand pounds as yet; More bye and bye. Yes, his good will Should go with me; he would not stir; He and my father in old time still Wish'd I should one day marry her; But God so seldom lets us take Our chosen pathway, when it lies In steps that either mar or make Or alter others' destinies, That, though his blessing and his pray'r Had help'd, should help, my suit, yet he Left all to me, his passive share Consent and opportunity. My chance, he hoped, was good: I'd won Some name already; friends and place Appear'd within my reach, but none Her mind and manners would not grace. Girls love to see the men in whom They invest their vanities admired; Besides, where goodness is, there room For good to work will be desired. 'Twas so with one now pass'd away; And what she was at twenty-two, Honor was now; and he might say Mine was a choice I could not rue. 4 He ceased, and gave his hand. He had won (And all my heart was in my word), From me the affection of a son, Whichever fortune Heaven conferr'd! Well, well, would I take more wine? Then go To her; she makes tea on the lawn These fine warm afternoons. And so We went whither my soul was drawn; And her light-hearted ignorance Of interest in our discourse Fill'd me with love, and seem'd to enhance Her beauty with pathetic force, As, through the flowery mazes sweet, Fronting the wind that flutter'd blythe, And loved her shape, and kiss'd her feet, Shown to their insteps proud and lithe, She approach'd, all mildness and young trust, And ever her chaste and noble air Gave to love's feast its choicest gust, A vague, faint augury of despair. CANTO VII. Ætna and the Moon. PRELUDES. I. _Love's Immortality_. How vilely 'twere to misdeserve The poet's gift of perfect speech, In song to try, with trembling nerve, The limit of its utmost reach, Only to sound the wretched praise Of what to-morrow shall not be; So mocking with immortal bays The cross-bones of mortality! I do not thus. My faith is fast That all the loveliness I sing Is made to bear the mortal blast, And blossom in a better Spring. Doubts of eternity ne'er cross The Lover's mind, divinely clear; _For ever_ is the gain or loss Which maddens him with hope or fear: So trifles serve for his relief, And trifles make him sick and pale; And yet his pleasure and his grief Are both on a majestic scale. The chance, indefinitely small, Of issue infinitely great, Eclipses finite interests all, And has the dignity of fate. II. _Heaven and Earth_. How long shall men deny the flower Because its roots are in the earth, And crave with tears from God the dower They have, and have despised as dearth, And scorn as low their human lot, With frantic pride, too blind to see That standing on the head makes not Either for ease or dignity! But fools shall feel like fools to find (Too late inform'd) that angels' mirth Is one in cause, and mode, and kind With that which they profaned on earth. ÆTNA AND THE MOON. 1 To soothe my heart I, feigning, seized A pen, and, showering tears, declared My unfeign'd passion; sadly pleased Only to dream that so I dared. Thus was the fervid truth confess'd, But wild with paradox ran the plea. As wilfully in hope depress'd, Yet bold beyond hope's warranty: 2 'O, more than dear, be more than just, And do not deafly shut the door! I claim no right to speak; I trust Mercy, not right; yet who has more? For, if more love makes not more fit, Of claimants here none's more nor less, Since your great worth does not permit Degrees in our unworthiness. Yet, if there's aught that can be done With arduous labour of long years, By which you'll say that you'll be won, O tell me, and I'll dry my tears. Ah, no; if loving cannot move, How foolishly must labour fail! The use of deeds is to show love; If signs suffice let these avail: Your name pronounced brings to my heart A feeling like the violet's breath, Which does so much of heaven impart It makes me amorous of death; The winds that in the garden toss The Guelder-roses give me pain, Alarm me with the dread of loss, Exhaust me with the dream of gain; I'm troubled by the clouds that move; Tired by the breath which I respire; And ever, like a torch, my love, Thus agitated, flames the higher; All's hard that has not you for goal; I scarce can move my hand to write, For love engages all my soul, And leaves the body void of might; The wings of will spread idly, as do The bird's that in a vacuum lies; My breast, asleep with dreams of you, Forgets to breathe, and bursts in sighs; I see no rest this side the grave, No rest nor hope, from you apart; Your life is in the rose you gave, Its perfume suffocates my heart; There's no refreshment in the breeze; The heaven o'erwhelms me with its blue; I faint beside the dancing seas; Winds, skies, and waves are only you; The thought or act which not intends You service seems a sin and shame; In that one only object ends Conscience, religion, honour, fame. Ah, could I put off love! Could we Never have met! What calm, what ease! Nay, but, alas, this remedy Were ten times worse than the disease! For when, indifferent, I pursue The world's best pleasures for relief, My heart, still sickening back to you, Finds none like memory of its grief; And, though 'twere very hell to hear You felt such misery as I, All good, save you, were far less dear! Than is that ill with which I die Where'er I go, wandering forlorn, You are the world's love, life, and glee: Oh, wretchedness not to be borne If she that's Love should not love me!' 3 I could not write another word, Through pity for my own distress; And forth I went, untimely stirr'd To make my misery more or less. I went, beneath the heated noon, To where, in her simplicity, She sate at work; and, as the Moon On Ætna smiles, she smiled on me. But, now and then, in cheek and eyes, I saw, or fancied, such a glow As when, in summer-evening skies, Some say, 'It lightens,' some say, 'No.' 'Honoria,' I began—No more. The Dean, by ill or happy hap, Came home; and Wolf burst in before, And put his nose upon her lap. CANTO VIII. Sarum Plain. PRELUDES. I. _Life of Life_. WHAT'S that, which, ere I spake, was gone? So joyful and intense a spark That, whilst o'erhead the wonder shone, The day, before but dull, grew dark. I do not know; but this I know, That, had the splendour lived a year, The truth that I some heavenly show Did see, could not be now more clear. This know I too: might mortal breath Express the passion then inspired, Evil would die a natural death, And nothing transient be desired; And error from the soul would pass, And leave the senses pure and strong As sunbeams. But the best, alas, Has neither memory nor tongue! II. _The Revelation_. An idle poet, here and there, Looks round him; but, for all the rest, The world, unfathomably fair, Is duller than a witling's jest. Love wakes men, once a lifetime each; They lift their heavy lids, and look; And, lo, what one sweet page can teach, They read with joy, then shut the book. And some give thanks, and some blaspheme, And most forget; but, either way, That and the Child's unheeded dream Is all the light of all their day. III. _The Spirit's Epochs_. Not in the crises of events, Of compass'd hopes, or fears fulfill'd, Or acts of gravest consequence, Are life's delight and depth reveal'd. The day of days was not the day; That went before, or was postponed; The night Death took our lamp away Was not the night on which we groan'd. I drew my bride, beneath the moon, Across my threshold; happy hour! But, ah, the walk that afternoon We saw the water-flags in flower! IV. _The Prototype_. Lo, there, whence love, life, light are pour'd, Veil'd with impenetrable rays, Amidst the presence of the Lord Co-equal Wisdom laughs and plays. Female and male God made the man; His image is the whole, not half; And in our love we dimly scan The love which is between Himself. V. _The Praise of Love_. Spirit of Knowledge, grant me this: A simple heart and subtle wit To praise the thing whose praise it is That all which can be praised is it. SARUM PLAIN. 1 Breakfast enjoy'd, 'mid hush of boughs And perfumes thro' the windows blown; Brief worship done, which still endows The day with beauty not its own; With intervening pause, that paints Each act with honour, life with calm (As old processions of the Saints At every step have wands of palm), We rose; the ladies went to dress, And soon return'd with smiles; and then, Plans fix'd, to which the Dean said 'Yes,' Once more we drove to Salisbury Plain. We past my house (observed with praise By Mildred, Mary acquiesced), And left the old and lazy greys Below the hill, and walk'd the rest. 2 The moods of love are like the wind, And none knows whence or why they rise: I ne'er before felt heart and mind So much affected through mine eyes. How cognate with the flatter'd air, How form'd for earth's familiar zone, She moved; how feeling and how fair For others' pleasure and her own! And, ah, the heaven of her face! How, when she laugh'd, I seem'd to see The gladness of the primal grace, And how, when grave, its dignity! Of all she was, the least not less Delighted the devoted eye; No fold or fashion of her dress Her fairness did not sanctify. I could not else than grieve. What cause? Was I not blest? Was she not there? Likely my own? Ah, that it was: How like seem'd 'likely' to despair! 3 And yet to see her so benign, So honourable and womanly, In every maiden kindness mine, And full of gayest courtesy, Was pleasure so without alloy, Such unreproved, sufficient bliss, I almost wish'd, the while, that joy Might never further go than this. So much it was as now to walk, And humbly by her gentle side Observe her smile and hear her talk, Could it be more to call her Bride? I feign'd her won: the mind finite, Puzzled and fagg'd by stress and strain To comprehend the whole delight, Made bliss more hard to bear than pain. All good, save heart to hold, so summ'd And grasp'd, the thought smote, like a knife, How laps'd mortality had numb'd The feelings to the feast of life; How passing good breathes sweetest breath; And love itself at highest reveals More black than bright, commending death By teaching how much life conceals. 4 But happier passions these subdued, When from the close and sultry lane, With eyes made bright by what they view'd, We emerged upon the mounded Plain. As to the breeze a flag unfurls, My spirit expanded, sweetly embraced By those same gusts that shook her curls And vex'd the ribbon at her waist. To the future cast I future cares; Breathed with a heart unfreighted, free, And laugh'd at the presumptuous airs That with her muslins folded me; Till, one vague rack along my sky, The thought that she might ne'er be mine Lay half forgotten by the eye So feasted with the sun's warm shine. 5 By the great stones we chose our ground For shade; and there, in converse sweet, Took luncheon. On a little mound Sat the three ladies; at their feet I sat; and smelt the heathy smell, Pluck'd harebells, turn'd the telescope To the country round. My life went well, For once, without the wheels of hope; And I despised the Druid rocks That scowl'd their chill gloom from above, Like churls whose stolid wisdom mocks The lightness of immortal love. And, as we talk'd, my spirit quaff'd The sparkling winds; the candid skies At our untruthful strangeness laugh'd; I kiss'd with mine her smiling eyes; And sweet familiarness and awe Prevail'd that hour on either part, And in the eternal light I saw That she was mine; though yet my heart Could not conceive, nor would confess Such contentation; and there grew More form and more fair stateliness Than heretofore between us two. CANTO IX. Sahara. PRELUDES. I. _The Wife's Tragedy_. MAN must be pleased; but him to please Is woman's pleasure; down the gulf Of his condoled necessities She casts her best, she flings herself. How often flings for nought, and yokes Her heart to an icicle or whim, Whose each impatient word provokes Another, not from her, but him; While she, too gentle even to force His penitence by kind replies, Waits by, expecting his remorse, With pardon in her pitying eyes; And if he once, by shame oppress'd, A comfortable word confers, She leans and weeps against his breast, And seems to think the sin was hers; And whilst his love has any life, Or any eye to see her charms, At any time, she's still his wife, Dearly devoted to his arms; She loves with love that cannot tire; And when, ah woe, she loves alone, Through passionate duty love springs higher, As grass grows taller round a stone. II. _Common Graces_. Is nature in thee too spiritless, Ignoble, impotent, and dead, To prize her love and loveliness The more for being thy daily bread? And art thou one of that vile crew Which see no splendour in the sun, Praising alone the good that's new, Or over, or not yet begun? And has it dawn'd on thy dull wits That love warms many as soft a nest, That, though swathed round with benefits, Thou art not singularly blest? And fail thy thanks for gifts divine, The common food of many a heart, Because they are not only thine? Beware lest in the end thou art Cast for thy pride forth from the fold, Too good to feel the common grace Of blissful myriads who behold For evermore the Father's face. III. _The Zest of Life_. Give thanks. It is not time misspent; Worst fare this betters, and the best, Wanting this natural condiment, Breeds crudeness, and will not digest. The grateful love the Giver's law; But those who eat, and look no higher, From sin or doubtful sanction draw The biting sauce their feasts require. Give thanks for nought, if you've no more, And, having all things, do not doubt That nought, with thanks, is blest before Whate'er the world can give, without. IV. _Fool and Wise_. Endow the fool with sun and moon, Being his, he holds them mean and low, But to the wise a little boon Is great, because the giver's so. SAHARA. 1 I stood by Honor and the Dean, They seated in the London train. A month from her! yet this had been, Ere now, without such bitter pain. But neighbourhood makes parting light, And distance remedy has none; Alone, she near, I felt as might A blind man sitting in the sun; She near, all for the time was well; Hope's self, when we were far apart, With lonely feeling, like the smell Of heath on mountains, fill'd my heart. To see her seem'd delight's full scope, And her kind smile, so clear of care, Ev'n then, though darkening all my hope, Gilded the cloud of my despair. 2 She had forgot to bring a book. I lent one; blamed the print for old; And did not tell her that she took A Petrarch worth its weight in gold. I hoped she'd lose it; for my love Was grown so dainty, high, and nice, It prized no luxury above The sense of fruitless sacrifice. 3 The bell rang, and, with shrieks like death, Link catching link, the long array, With ponderous pulse and fiery breath, Proud of its burthen, swept away; And through the lingering crowd I broke, Sought the hill-side, and thence, heart-sick, Beheld, far off, the little smoke Along the landscape kindling quick. 4 What should I do, where should I go, Now she was gone, my love! for mine She was, whatever here below Cross'd or usurp'd my right divine. Life, without her, was vain and gross, The glory from the world was gone, And on the gardens of the Close As on Sahara shone the sun. Oppress'd with her departed grace, My thoughts on ill surmises fed; The harmful influence of the place She went to fill'd my soul with dread. She, mixing with the people there, Might come back alter'd, having caught The foolish, fashionable air Of knowing all, and feeling nought. Or, giddy with her beauty's praise, She'd scorn our simple country life, Its wholesome nights and tranquil days. And would not deign to be my Wife. 'My Wife,' 'my Wife,' ah, tenderest word! How oft, as fearful she might hear, Whispering that name of 'Wife,' I heard The chiming of the inmost sphere. 5 I pass'd the home of my regret. The clock was striking in the hall, And one sad window open yet, Although the dews began to fall. Ah, distance show'd her beauty's scope! How light of heart and innocent That loveliness which sicken'd hope And wore the world for ornament! How perfectly her life was framed; And, thought of in that passionate mood, How her affecting graces shamed The vulgar life that was but good! 6 I wonder'd, would her bird be fed, Her rose-plots water'd, she not by; Loading my breast with angry dread Of light, unlikely injury. So, fill'd with love and fond remorse, I paced the Close, its every part Endow'd with reliquary force To heal and raise from death my heart. How tranquil and unsecular The precinct! Once, through yonder gate, I saw her go, and knew from far Her love-lit form and gentle state. Her dress had brush'd this wicket; here She turn'd her face, and laugh'd, with light Like moonbeams on a wavering mere. Weary beforehand of the night, I went; the blackbird, in the wood Talk'd by himself, and eastward grew In heaven the symbol of my mood, Where one bright star engross'd the blue. CANTO X. Church to Church. PRELUDES. I. _The Joyful Wisdom_. WOULD Wisdom for herself be woo'd, And wake the foolish from his dream, She must be glad as well as good, And must not only be, but seem. Beauty and joy are hers by right; And, knowing this, I wonder less That she's so scorn'd, when falsely dight In misery and ugliness. What's that which Heaven to man endears, And that which eyes no sooner see Than the heart says, with floods of tears, 'Ah, that's the thing which I would be!' Not childhood, full of frown and fret; Not youth, impatient to disown Those visions high, which to forget Were worse than never to have known; Not worldlings, in whose fair outside Nor courtesy nor justice fails, Thanks to cross-pulling vices tied, Like Samson's foxes, by the tails; Not poets; real things are dreams, When dreams are as realities, And boasters of celestial gleams Go stumbling aye for want of eyes; Not patriots or people's men, In whom two worse-match'd evils meet Than ever sought Adullam's den, Base conscience and a high conceit; Not new-made saints, their feelings iced, Their joy in man and nature gone, Who sing 'O easy yoke of Christ!' But find 'tis hard to get it on; Not great men, even when they're good; The good man whom the time makes great, By some disgrace of chance or blood, God fails not to humiliate; Not these: but souls, found here and there, Oases in our waste of sin, Where everything is well and fair, And Heav'n remits its discipline; Whose sweet subdual of the world The worldling scarce can recognise, And ridicule, against it hurl'd, Drops with a broken sting and dies; Who nobly, if they cannot know Whether a 'scutcheon's dubious field Carries a falcon or a crow, Fancy a falcon on the shield; Yet, ever careful not to hurt God's honour, who creates success, Their praise of even the best desert Is but to have presumed no less; Who, should their own life plaudits bring, Are simply vex'd at heart that such An easy, yea, delightful thing Should move the minds of men so much. They live by law, not like the fool, But like the bard, who freely sings In strictest bonds of rhyme and rule, And finds in them, not bonds, but wings. Postponing still their private ease To courtly custom, appetite, Subjected to observances, To banquet goes with full delight; Nay, continence and gratitude So cleanse their lives from earth's alloy, They taste, in Nature's common food, Nothing but spiritual joy. They shine like Moses in the face, And teach our hearts, without the rod, That God's grace is the only grace, And all grace is the grace of God. II. _The Devices_. Love, kiss'd by Wisdom, wakes twice Love, And Wisdom is, thro' loving, wise. Let Dove and Snake, and Snake and Dove, This Wisdom's be, that Love's device. GOING TO CHURCH. 1 I woke at three; for I was bid To breakfast with the Dean at nine, And thence to Church. My curtain slid, I found the dawning Sunday fine, And could not rest, so rose. The air Was dark and sharp; the roosted birds Cheep'd, 'Here am I, Sweet; are you there?' On Avon's misty flats the herds Expected, comfortless, the day, Which slowly fired the clouds above; The cock scream'd, somewhere far away; In sleep the matrimonial dove Was crooning; no wind waked the wood, Nor moved the midnight river-damps, Nor thrill'd the poplar; quiet stood The chestnut with its thousand lamps; The moon shone yet, but weak and drear, And seem'd to watch, with bated breath, The landscape, all made sharp and clear By stillness, as a face by death. 2 My pray'rs for her being done, I took Occasion by the quiet hour To find and know, by Rule and Book, The rights of love's beloved power. 3 Fronting the question without ruth, Nor ignorant that, evermore, If men will stoop to kiss the Truth, She lifts them higher than before, I, from above, such light required As now should once for all destroy The folly which at times desired A sanction for so great a joy. 4 Thenceforth, and through that pray'r, I trod A path with no suspicions dim. I loved her in the name of God, And for the ray she was of Him; I ought to admire much more, not less Her beauty was a godly grace; The mystery of loveliness, Which made an altar of her face, Was not of the flesh, though that was fair, But a most pure and living light Without a name, by which the rare And virtuous spirit flamed to sight. If oft, in love, effect lack'd cause And cause effect, 'twere vain to soar Reasons to seek for that which was Reason itself, or something more. My joy was no idolatry Upon the ends of the vile earth bent, For when I loved her most then I Most yearn'd for more divine content. That other doubt, which, like a ghost, In the brain's darkness haunted me, Was thus resolved: Him loved I most, But her I loved most sensibly. Lastly, my giddiest hope allow'd No selfish thought, or earthly smirch; And forth I went, in peace, and proud To take my passion into Church; Grateful and glad to think that all Such doubts would seem entirely vain To her whose nature's lighter fall Made no divorce of heart from brain. 5 I found them, with exactest grace And fresh as Spring, for Spring attired; And by the radiance in her face I saw she felt she was admired; And, through the common luck of love, A moment's fortunate delay, To fit the little lilac glove, Gave me her arm; and I and they (They true to this and every hour, As if attended on by Time), Enter'd the Church while yet the tower Was noisy with the finish'd chime. 6 Her soft voice, singularly heard Beside me, in her chant, withstood The roar of voices, like a bird Sole warbling in a windy wood; And, when we knelt, she seem'd to be An angel teaching me to pray; And all through the high Liturgy My spirit rejoiced without allay, Being, for once, borne clearly above All banks and bars of ignorance, By this bright spring-tide of pure love, And floated in a free expanse, Whence it could see from side to side, The obscurity from every part Winnow'd away and purified By the vibrations of my heart. CANTO XI. The Dance. PRELUDES. I. _The Daughter of Eve_. THE woman's gentle mood o'erstept Withers my love, that lightly scans The rest, and does in her accept All her own faults, but none of man's. As man I cannot judge her ill, Or honour her fair station less, Who, with a woman's errors, still Preserves a woman's gentleness; For thus I think, if one I see Who disappoints my high desire, 'How admirable would she be, Could she but know how I admire!' Or fail she, though from blemish clear, To charm, I call it my defect; And so my thought, with reverent fear To err by doltish disrespect, Imputes love's great regard, and says, 'Though unapparent 'tis to me, Be sure this Queen some other sways With well-perceiv'd supremacy.' Behold the worst! Light from above On the blank ruin writes 'Forbear! Her first crime was unguarded love, And all the rest, perhaps, despair.' Discrown'd, dejected, but not lost, O, sad one, with no more a name Or place in all the honour'd host Of maiden and of matron fame, Grieve on; but, if thou grievest right, 'Tis not that these abhor thy state, Nor would'st thou lower the least the height Which makes thy casting down so great. Good is thy lot in its degree; For hearts that verily repent Are burden'd with impunity And comforted by chastisement. Sweet patience sanctify thy woes! And doubt not but our God is just, Albeit unscathed thy traitor goes, And thou art stricken to the dust. That penalty's the best to bear Which follows soonest on the sin; And guilt's a game where losers fare Better than those who seem to win. II. _Aurea Dicta_. 'Tis truth (although this truth's a star Too deep-enskied for all to see), As poets of grammar, lovers are The fountains of morality. Child, would you shun the vulgar doom, In love disgust, in death despair? Know, death must come and love must come, And so for each your soul prepare. Who pleasure follows pleasure slays; God's wrath upon himself he wreaks; But all delights rejoice his days Who takes with thanks, and never seeks. The wrong is made and measured by The right's inverted dignity. Change love to shame, as love is high So low in hell your bed shall be. How easy to keep free from sin! How hard that freedom to recall! For dreadful truth it is that men Forget the heavens from which they fall. Lest sacred love your soul ensnare, With pious fancy still infer 'How loving and how lovely fair Must He be who has fashion'd her!' Become whatever good you see, Nor sigh if, forthwith, fades from view The grace of which you may not be The subject and spectator too. Love's perfect blossom only blows Where noble manners veil defect Angels maybe familiar; those Who err each other must respect. Love blabb'd of is a great decline; A careless word unsanctions sense; But he who casts Heaven's truth to swine Consummates all incontinence. Not to unveil before the gaze Of an imperfect sympathy In aught we are, is the sweet praise And the main sum of modesty. THE DANCE. 1 'My memory of Heaven awakes! She's not of the earth, although her light, As lantern'd by her body, makes A piece of it past bearing bright. So innocently proud and fair She is, that Wisdom sings for glee And Folly dies, breathing one air With such a bright-cheek'd chastity; And though her charms are a strong law Compelling all men to admire, They go so clad with lovely awe None but the noble dares desire. He who would seek to make her his Will comprehend that souls of grace Own sweet repulsion, and that 'tis The quality of their embrace To be like the majestic reach Of coupled suns, that, from afar, Mingle their mutual spheres, while each Circles the twin obsequious star; And, in the warmth of hand to hand, Of heart to heart, he'll vow to note And reverently understand How the two spirits shine remote; And ne'er to numb fine honour's nerve, Nor let sweet awe in passion melt, Nor fail by courtesies to observe The space which makes attraction felt; Nor cease to guard like life the sense Which tells him that the embrace of love Is o'er a gulf of difference Love cannot sound, nor death remove.' 2 This learn'd I, watching where she danced, Native to melody and light, And now and then toward me glanced, Pleased, as I hoped, to please my sight. 3 Ah, love to speak was impotent, Till music did a tongue confer, And I ne'er knew what music meant, Until I danced to it with her. Too proud of the sustaining power Of my, till then, unblemish'd joy. My passion, for reproof, that hour Tasted mortality's alloy, And bore me down an eddying gulf; I wish'd the world might run to wreck, So I but once might fling myself Obliviously about her neck. I press'd her hand, by will or chance I know not, but I saw the rays Withdrawn, which did till then enhance Her fairness with its thanks for praise. I knew my spirit's vague offence Was patent to the dreaming eye And heavenly tact of innocence, And did for fear my fear defy, And ask'd her for the next dance. 'Yes.' 'No,' had not fall'n with half the force. She was fulfill'd with gentleness, And I with measureless remorse; And, ere I slept, on bended knee I own'd myself, with many a tear, Unseasonable, disorderly, And a deranger of love's sphere; Gave thanks that, when we stumble and fall, We hurt ourselves, and not the truth; And, rising, found its brightness all The brighter through the tears of ruth. 4 Nor was my hope that night made less, Though order'd, humbled, and reproved; Her farewell did her heart express As much, but not with anger, moved. My trouble had my soul betray'd; And, in the night of my despair, My love, a flower of noon afraid, Divulged its fulness unaware. I saw she saw; and, O sweet Heaven, Could my glad mind have credited That influence had to me been given To affect her so, I should have said That, though she from herself conceal'd Love's felt delight and fancied harm, They made her face the jousting field Of joy and beautiful alarm. CANTO XII. The Abdication. PRELUDES. I. _The Chace_. SHE wearies with an ill unknown; In sleep she sobs and seems to float, A water-lily, all alone Within a lonely castle-moat; And as the full-moon, spectral, lies Within the crescent's gleaming arms, The present shows her heedless eyes A future dim with vague alarms. She sees, and yet she scarcely sees, For, life-in-life not yet begun, Too many are its mysteries For thought to fix on any one. She's told that maidens are by youths Extremely honour'd and desired; And sighs, 'If those sweet tales be truths, What bliss to be so much admired!' The suitors come; she sees them grieve; Her coldness fills them with despair; She'd pity if she could believe; She's sorry that she cannot care. But who now meets her on her way? Comes he as enemy or friend, Or both? Her bosom seems to say, He cannot pass, and there an end. Whom does he love? Does he confer His heart on worth that answers his? Or is he come to worship her? She fears, she hopes, she thinks he is! Advancing stepless, quick, and still, As in the grass a serpent glides, He fascinates her fluttering will, Then terrifies with dreadful strides. At first, there's nothing to resist; He fights with all the forms of peace; He comes about her like a mist, With subtle, swift, unseen increase; And then, unlook'd for, strikes amain Some stroke that frightens her to death, And grows all harmlessness again, Ere she can cry, or get her breath. At times she stops, and stands at bay; But he, in all more strong than she, Subdues her with his pale dismay, Or more admired audacity. She plans some final, fatal blow, But when she means with frowns to kill, He looks as if he loved her so, She smiles to him against her will. How sweetly he implies her praise! His tender talk, his gentle tone, The manly worship in his gaze, They nearly make her heart his own. With what an air he speaks her name; His manner always recollects Her sex, and still the woman's claim Is taught its scope by his respects. Her charms, perceived to prosper first In his beloved advertencies, When in her glass they are rehearsed, Prove his most powerful allies. Ah, whither shall a maiden flee, When a bold youth so swift pursues, And siege of tenderest courtesy, With hope perseverant, still renews! Why fly so fast? Her flatter'd breast Thanks him who finds her fair and good; She loves her fears; veil'd joys arrest The foolish terrors of her blood; By secret, sweet degrees, her heart, Vanquish'd, takes warmth from his desire; She makes it more, with hidden art, And fuels love's late dreaded fire. The generous credit he accords To all the signs of good in her Redeems itself; his praiseful words The virtues they impute confer. Her heart is thrice as rich in bliss, She's three times gentler than before; He gains a right to call her his, Now she through him is so much more; 'Tis heaven where'er she turns her head; 'Tis music when she talks; 'tis air On which, elate, she seems to tread, The convert of a gladder sphere! Ah, might he, when by doubts aggrieved, Behold his tokens next her breast, At all his words and sighs perceived Against its blythe upheaval press'd! But still she flies. Should she be won, It must not be believed or thought She yields; she's chased to death, undone, Surprised, and violently caught. II. _Denied_. The storm-cloud, whose portentous shade Fumes from a core of smother'd fire, His livery is whose worshipp'd maid Denies herself to his desire. Ah, grief that almost crushes life, To lie upon his lonely bed, And fancy her another's wife! His brain is flame, his heart is lead. Sinking at last, by nature's course, Cloak'd round with sleep from his despair, He does but sleep to gather force That goes to his exhausted care. He wakes renew'd for all the smart. His only Love, and she is wed! His fondness comes about his heart, As milk comes, when the babe is dead. The wretch, whom she found fit for scorn, His own allegiant thoughts despise; And far into the shining morn Lazy with misery he lies. III. _The Churl_. This marks the Churl: when spousals crown His selfish hope, he finds the grace, Which sweet love has for ev'n the clown, Was not in the woman, but the chace. THE ABDICATION. 1 From little signs, like little stars, Whose faint impression on the sense The very looking straight at mars, Or only seen by confluence; From instinct of a mutual thought, Whence sanctity of manners flow'd; From chance unconscious, and from what Concealment, overconscious, show'd; Her hand's less weight upon my arm, Her lowlier mien; that match'd with this; I found, and felt with strange alarm I stood committed to my bliss. 2 I grew assured, before I ask'd, That she'd be mine without reserve, And in her unclaim'd graces bask'd, At leisure, till the time should serve, With just enough of dread to thrill The hope, and make it trebly dear; Thus loth to speak the word to kill Either the hope or happy fear. 3 Till once, through lanes returning late, Her laughing sisters lagg'd behind; And, ere we reach'd her father's gate, We paused with one presentient mind; And, in the dim and perfumed mist, Their coming stay'd, who, friends to me, And very women, loved to assist Love's timid opportunity. 4 Twice rose, twice died my trembling word; The faint and frail Cathedral chimes Spake time in music, and we heard The chafers rustling in the limes. Her dress, that touch'd me where I stood, The warmth of her confided arm, Her bosom's gentle neighbourhood, Her pleasure in her power to charm; Her look, her love, her form, her touch, The least seem'd most by blissful turn, Blissful but that it pleased too much, And taught the wayward soul to yearn. It was as if a harp with wires Was traversed by the breath I drew; And, oh, sweet meeting of desires, She, answering, own'd that she loved too. 5 Honoria was to be my bride! The hopeless heights of hope were scaled The summit won, I paused and sigh'd, As if success itself had fail'd. It seem'd as if my lips approach'd To touch at Tantalus' reward, And rashly on Eden life encroach'd, Half-blinded by the flaming sword. The whole world's wealthiest and its best, So fiercely sought, appear'd when found, Poor in its need to be possess'd, Poor from its very want of bound. My queen was crouching at my side, By love unsceptred and brought low, Her awful garb of maiden pride All melted into tears like snow; The mistress of my reverent thought, Whose praise was all I ask'd of fame, In my close-watch'd approval sought Protection as from danger and blame; Her soul, which late I loved to invest With pity for my poor desert, Buried its face within my breast, Like a pet fawn by hunters hurt. Book II. THE PROLOGUE. 1 HER sons pursue the butterflies, Her baby daughter mocks the doves With throbbing coo; in his fond eyes She's Venus with her little Loves; Her footfall dignifies the earth, Her form's the native-land of grace, And, lo, his coming lights with mirth Its court and capital her face! Full proud her favour makes her lord, And that her flatter'd bosom knows. She takes his arm without a word, In lanes of laurel and of rose. Ten years to-day has she been his. He but begins to understand, He says, the dignity and bliss She gave him when she gave her hand. She, answering, says, he disenchants The past, though that was perfect; he Rejoins, the present nothing wants But briefness to be ecstasy. He lands her charms; her beauty's glow Wins from the spoiler Time new rays; Bright looks reply, approving so Beauty's elixir vitæ, praise. Upon a beech he bids her mark Where, ten years since, he carved her name; It grows there with the growing bark, And in his heart it grows the same. For that her soft arm presses his Close to her fond, maternal breast; He tells her, each new kindness is The effectual sum of all the rest! And, whilst the cushat, mocking, coo'd, They blest the days they had been wed, At cost of those in which he woo'd, Till everything was three times said; And words were growing vain, when Briggs, Factotum, Footman, Butler, Groom, Who press'd the cyder, fed the pigs, Preserv'd the rabbits, drove the brougham, And help'd, at need, to mow the lawns, And sweep the paths and thatch the hay, Here brought the Post down, Mrs. Vaughan's Sole rival, but, for once, to-day, Scarce look'd at; for the 'Second Book,' Till this tenth festival kept close, Was thus commenced, while o'er them shook The laurel married with the rose. 2 'The pulse of War, whose bloody heats Sane purposes insanely work, Now with fraternal frenzy beats, And binds the Christian to the Turk, And shrieking fifes'— 3 But, with a roar, In rush'd the Loves; the tallest roll'd A hedgehog from his pinafore, Which saved his fingers; Baby, bold, Touch'd it, and stared, and scream'd for life, And stretch'd her hand for Vaughan to kiss, Who hugg'd his Pet, and ask'd his wife, 'Is this for love, or love for this?' But she turn'd pale, for, lo, the beast, Found stock-still in the rabbit-trap, And feigning so to be deceased, And laid by Frank upon her lap, Unglobed himself, and show'd his snout, And fell, scatt'ring the Loves amain, With shriek, with laughter, and with shout; And, peace at last restored again, The bard, who this untimely hitch Bore with a calm magnanimous, (The hedgehog rolled into a ditch, And Venus sooth'd), proceeded thus: CANTO I. Accepted. PRELUDES. I. _The Song of Songs_. THE pulse of War, whose bloody heats Sane purposes insanely work, Now with fraternal frenzy beats, And binds the Christian to the Turk, And shrieking fifes and braggart flags, Through quiet England, teach our breath The courage corporate that drags The coward to heroic death. Too late for song! Who henceforth sings, Must fledge his heavenly flight with more Song-worthy and heroic things Than hasty, home-destroying war. While might and right are not agreed, And battle thus is yet to wage, So long let laurels be the meed Of soldier as of poet sage; But men expect the Tale of Love, And weary of the Tale of Hate; Lift me, O Muse, myself above, And let the world no longer wait! II. _The Kites_. I saw three Cupids (so I dream'd), Who made three kites, on which were drawn, In letters that like roses gleam'd, 'Plato,' 'Anacreon,' and 'Vaughan.' The boy who held by Plato tried His airy venture first; all sail, It heav'nward rush'd till scarce descried, Then pitch'd and dropp'd for want of tail. Anacreon's Love, with shouts of mirth That pride of spirit thus should fall, To his kite link'd a lump of earth, And, lo, it would not soar at all. Last, my disciple freighted his With a long streamer made of flowers, The children of the sod, and this Rose in the sun, and flew for hours. III. _Orpheus_. The music of the Sirens found Ulysses weak, though cords were strong; But happier Orpheus stood unbound, And shamed it with a sweeter song. His mode be mine. Of Heav'n I ask, May I, with heart-persuading might, Pursue the Poet's sacred task Of superseding faith by sight, Till ev'n the witless Gadarene, Preferring Christ to swine, shall know That life is sweetest when it's clean. To prouder folly let me show Earth by divine light made divine; And let the saints, who hear my word, Say, 'Lo, the clouds begin to shine About the coming of the Lord!' IV. _Nearest the Dearest_. Till Eve was brought to Adam, he A solitary desert trod, Though in the great society Of nature, angels, and of God. If one slight column counterweighs The ocean, 'tis the Maker's law, Who deems obedience better praise Than sacrifice of erring awe. V. _Perspective_. What seems to us for us is true. The planet has no proper light, And yet, when Venus is in view, No primal star is half so bright. ACCEPTED. 1 What fortune did my heart foretell? What shook my spirit, as I woke, Like the vibration of a bell Of which I had not heard the stroke? Was it some happy vision shut From memory by the sun's fresh ray? Was it that linnet's song; or but A natural gratitude for day? Or the mere joy the senses weave, A wayward ecstasy of life? Then I remember'd, yester-eve I won Honoria for my Wife. 2 Forth riding, while as yet the day Was dewy, watching Sarum Spire, Still beckoning me along my way, And growing every minute higher, I reach'd the Dean's. One blind was down, Though nine then struck. My bride to be! And had she rested ill, my own, With thinking (oh, my heart!) of me? I paced the streets; a pistol chose, To guard my now important life When riding late from Sarum Close; At noon return'd. Good Mrs. Fife, To my, 'The Dean, is he at home?' Said, 'No, sir; but Miss Honor is;' And straight, not asking if I'd come, Announced me, 'Mr. Felix, Miss,' To Mildred, in the Study. There We talk'd, she working. We agreed The day was fine; the Fancy-Fair Successful; 'Did I ever read De Genlis?' 'Never.' 'Do! She heard I was engaged.' 'To whom?' 'Miss Fry Was it the fact?' 'No!' 'On my word?' 'What scandal people talk'd!' 'Would I Hold out this skein of silk.' So pass'd I knew not how much time away. 'How were her sisters?' 'Well.' At last I summon'd heart enough to say, 'I hoped to have seen Miss Churchill too.' 'Miss Churchill, Felix! What is this? I said, and now I find 'tis true, Last night you quarrell'd! Here she is.' 3 She came, and seem'd a morning rose When ruffling rain has paled its blush; Her crown once more was on her brows; And, with a faint, indignant flush, And fainter smile, she gave her hand, But not her eyes, then sate apart, As if to make me understand The honour of her vanquish'd heart. But I drew humbly to her side; And she, well pleased, perceiving me Liege ever to the noble pride Of her unconquer'd majesty, Once and for all put it away; The faint flush pass'd; and, thereupon, Her loveliness, which rather lay In light than colour, smiled and shone, Till sick was all my soul with bliss; Or was it with remorse and ire Of such a sanctity as this Subdued by love to my desire? CANTO II. The Course of True Love. PRELUDES. I. _The Changed Allegiance_. WATCH how a bird, that captived sings, The cage set open, first looks out, Yet fears the freedom of his wings, And now withdraws, and flits about, And now looks forth again; until, Grown bold, he hops on stool and chair, And now attains the window-sill, And now confides himself to air. The maiden so, from love's free sky In chaste and prudent counsels caged, But longing to be loosen'd by Her suitor's faith declared and gaged, When blest with that release desired, First doubts if truly she is free, Then pauses, restlessly retired, Alarm'd at too much liberty; But soon, remembering all her debt To plighted passion, gets by rote Her duty; says, 'I love him!' yet The thought half chokes her in her throat; And, like that fatal 'I am thine,' Comes with alternate gush and check And joltings of the heart, as wine Pour'd from a flask of narrow neck. Is he indeed her choice? She fears Her Yes was rashly said, and shame, Remorse and ineffectual tears Revolt from has conceded claim. Oh, treason! So, with desperate nerve, She cries, 'I am in love, am his;' Lets run the cables of reserve, And floats into a sea of bliss, And laughs to think of her alarm, Avows she was in love before, Though has avowal was the charm Which open'd to her own the door. She loves him for his mastering air, Whence, Parthian-like, she slaying flies; His flattering look, which seems to wear Her loveliness in manly eyes; His smile, which, by reverse, portends An awful wrath, should reason stir; (How fortunate it is they're friends, And he will ne'er be wroth with her!) His power to do or guard from harm; If he but chose to use it half, And catch her up in one strong arm, What could she do but weep, or laugh! His words, which still instruct, but so That this applause seems still implied, 'How wise in all she ought to know, How ignorant of all beside!' His skilful suit, which leaves her free, Gives nothing for the world to name, And keeps her conscience safe, while he, With half the bliss, takes all the blame; His clear repute with great and small; The jealousy his choice will stir; But ten times more than ten times all, She loves him for his love of her. How happy 'tis he seems to see In her that utter loveliness Which she, for his sake, longs to be! At times, she cannot but confess Her other friends are somewhat blind; Her parents' years excuse neglect, But all the rest are scarcely kind, And brothers grossly want respect; And oft she views what he admires Within her glass, and sight of this Makes all the sum of her desires To be devotion unto his. But still, at first, whatever's done, A touch, her hand press'd lightly, she Stands dizzied, shock'd, and flush'd, like one Set sudden neck-deep in the sea; And, though her bond for endless time To his good pleasure gives her o'er, The slightest favour seems a crime, Because it makes her love him more. But that she ne'er will let him know; For what were love should reverence cease? A thought which makes her reason so Inscrutable, it seems caprice. With her, as with a desperate town, Too weak to stand, too proud to treat, The conqueror, though the walls are down, Has still to capture street by street; But, after that, habitual faith, Divorced from self, where late 'twas due, Walks nobly in its novel path, And she's to changed allegiance true; And prizing what she can't prevent, (Right wisdom, often misdeem'd whim), Her will's indomitably bent On mere submissiveness to him; To him she'll cleave, for him forsake Father's and mother's fond command! He is her lord, for he can take Hold of her faint heart with his hand. II. _Beauty_. 'Beauty deludes.' O shaft well shot, To strike the mark's true opposite! That ugly good is scorn'd proves not 'Tis beauty lies, but lack of it. By Heaven's law the Jew might take A slave to wife, if she was fair; So strong a plea does beauty make That, where 'tis seen, discretion's there. If, by a monstrous chance, we learn That this illustrious vaunt's a lie, Our minds, by which the eyes discern, See hideous contrariety. And laugh at Nature's wanton mood, Which, thus a swinish thing to flout, Though haply in its gross way good, Hangs such a jewel in its snout. III. _Lais and Lucretia_. Did first his beauty wake her sighs? That's Lais! Thus Lucretia's known: The beauty in her Lover's eyes Was admiration of her own. THE COURSE OF TRUE LOVE. 1 Oh, beating heart of sweet alarm, Which stays the lover's step, when near His mistress and her awful charm Of grace and innocence sincere! I held the half-shut door, and heard The voice of my betrothed wife, Who sang my verses, every word By music taught its latent life; With interludes of well-touch'd notes, That flash'd, surprising and serene, As meteor after meteor floats The soft, autumnal stars between. There was a passion in her tone, A tremor when she touch'd the keys, Which told me she was there alone, And uttering all her soul at ease. I enter'd; for I did not choose To learn how in her heart I throve, By chance or stealth; beyond her use, Her greeting flatter'd me with love. 2 With true love's treacherous confidence, And ire, at last to laughter won, She spoke this speech, and mark'd its sense, By action, as her Aunt had done. 3 '"You, with your looks and catching air, To think of Vaughan! You fool! You know, You might, with ordinary care, Ev'n yet be Lady Clitheroe. You're sure he'll do great things some day! Nonsense, he won't; he's dress'd too well. Dines with the Sterling Club, they say; Not commonly respectable! Half Puritan, half Cavalier! His curly hair I think's a wig; And, for his fortune, why my Dear, 'Tis not enough to keep a gig. Rich Aunts and Uncles never die; And what you bring won't do for dress: And so you'll live on By-and-by, Within oaten-cake and water-cress!" 4 'I cried, but did not let her see. At last she soften'd her dispraise, On learning you had bought for me A carriage and a pair of bays. But here she comes! You take her in To dinner. I impose this task Make her approve my love; and win What thanks from me you choose to ask!' 5 'My niece has told you every word I said of you! What may I mean? Of course she has; but you've not heard How I abused you to the Dean;— Yes, I'll take wine; he's mad, like her; And she _will_ have you: there it ends! And, now I've done my duty, Sir, And you've shown common-sense, we're friends!' 6 'Go, child, and see him out yourself,' Aunt Maude said, after tea, 'and show The place, upon that upper shelf, Where Petrarch stands, lent long ago.' 7 'These rose-leaves to my heart be press'd, Honoria, while it aches for you!' (The rose in ruin, from her breast, Fell, as I took a fond adieu.) 'You must go now, Love!' 'See, the air Is thick with starlight!' 'Let me tie This scarf on. Oh, your Petrarch! There! I'm coming, Aunt!' 'Sweet, Sweet!' 'Good-bye!' 'Ah, Love, to me 'tis death to part, Yet you, my sever'd life, smile on!' These "Good-nights," Felix, break my heart; I'm only gay till you are gone!' With love's bright arrows from her eyes, And balm on her permissive lips, She pass'd, and night was a surprise, As when the sun at Quito dips. Her beauties were like sunlit snows, Flush'd but not warm'd with my desire. Oh, how I loved her! Fiercely glows In the pure air of frost the fire. Who for a year is sure of fate! I thought, dishearten'd as I went, Wroth with the Dean, who bade me wait, And vex'd with her, who seem'd content. Nay, could eternal life afford That tyranny should thus deduct From this fair land, which call'd me lord, A year of the sweet usufruct? It might not and it should not be! I'd go back now, and he must own, At once, my love's compulsive plea. I turn'd, I found the Dean alone. 'Nonsense, my friend; go back to bed! It's half-past twelve!' 'July, then, Sir!' 'Well, come to-morrow,' at last he said, 'And you may talk of it with her.' A light gleam'd as I pass'd the stair. A pausing foot, a flash of dress, And a sweet voice. 'Is Felix there?' 'July, Love!' 'Says Papa so?' 'Yes!' CANTO III. The Country Ball. PRELUDES. I. _Love Ceremonious_. KEEP your undrest, familiar style For strangers, but respect your friend, Her most, whose matrimonial smile Is and asks honour without end. 'Tis found, and needs it must so be, That life from love's allegiance flags, When love forgets his majesty In sloth's unceremonious rags. Let love make home a gracious Court; There let the world's rude, hasty ways Be fashion'd to a loftier port, And learn to bow and stand at gaze; And let the sweet respective sphere Of personal worship there obtain Circumference for moving clear, None treading on another's train. This makes that pleasures do not cloy, And dignifies our mortal strife With calmness and considerate joy, Befitting our immortal life. II. _The Rainbow_. A stately rainbow came and stood, When I was young, in High-Hurst Park; Its bright feet lit the hill and wood Beyond, and cloud and sward were dark; And I, who thought the splendour ours Because the place was, t'wards it flew, And there, amidst the glittering showers, Gazed vainly for the glorious view. With whatsoever's lovely, know It is not ours; stand off to see, Or beauty's apparition so Puts on invisibility. III. _A Paradox_. To tryst Love blindfold goes, for fear He should not see, and eyeless night He chooses still for breathing near Beauty, that lives but in the sight. THE COUNTY BALL. 1 Well, Heaven be thank'd my first-love fail'd, As, Heaven be thank'd, our first-loves do! Thought I, when Fanny past me sail'd, Loved once, for what I never knew, Unless for colouring in her talk, When cheeks and merry mouth would show Three roses on a single stalk, The middle wanting room to blow, And forward ways, that charm'd the boy Whose love-sick mind, misreading fate, Scarce hoped that any Queen of Joy Could ever stoop to be his mate. 2 But there danced she, who from the leaven Of ill preserv'd my heart and wit All unawares, for she was heaven, Others at best but fit for it. One of those lovely things she was In whose least action there can be Nothing so transient but it has An air of immortality. I mark'd her step, with peace elate, Her brow more beautiful than morn, Her sometime look of girlish state Which sweetly waived its right to scorn; The giddy crowd, she grave the while, Although, as 'twere beyond her will, Around her mouth the baby smile That she was born with linger'd still. Her ball-dress seem'd a breathing mist, From the fair form exhaled and shed, Raised in the dance with arm and wrist All warmth and light, unbraceleted. Her motion, feeling 'twas beloved, The pensive soul of tune express'd, And, oh, what perfume, as she moved, Came from the flowers in her breast! How sweet a tongue the music had! 'Beautiful Girl,' it seem'd to say, 'Though all the world were vile and sad, Dance on; let innocence be gay.' Ah, none but I discern'd her looks, When in the throng she pass'd me by, For love is like a ghost, and brooks Only the chosen seer's eye; And who but she could e'er divine The halo and the happy trance, When her bright arm reposed on mine, In all the pauses of the dance! 3 Whilst so her beauty fed my sight, And whilst I lived in what she said, Accordant airs, like all delight Most sweet when noted least, were play'd; And was it like the Pharisee If I in secret bow'd my face With joyful thanks that I should be, Not as were many, but with grace And fortune of well-nurtured youth, And days no sordid pains defile, And thoughts accustom'd to the truth, Made capable of her fair smile? 4 Charles Barton follow'd down the stair, To talk with me about the Ball, And carp at all the people there. The Churchills chiefly stirr'd his gall: 'Such were the Kriemhilds and Isondes You storm'd about at Trinity! Nothing at heart but handsome Blondes! 'Folk say that you and Fanny Fry—' 'They err! Good-night! Here lies my course, Through Wilton.' Silence blest my ears, And, weak at heart with vague remorse, A passing poignancy of tears Attack'd mine eyes. By pale and park I rode, and ever seem'd to see, In the transparent starry dark, That splendid brow of chastity, That soft and yet subduing light, At which, as at the sudden moon, I held my breath, and thought 'how bright!' That guileless beauty in its noon, Compelling tribute of desires Ardent as day when Sirius reigns, Pure as the permeating fires That smoulder in the opal's veins. CANTO IV. Love in Idleness. PRELUDES. I. _Honour and Desert_. O QUEEN, awake to thy renown, Require what 'tis our wealth to give, And comprehend and wear the crown Of thy despised prerogative! I, who in manhood's name at length With glad songs come to abdicate The gross regality of strength, Must yet in this thy praise abate, That, through thine erring humbleness And disregard of thy degree, Mainly, has man been so much less Than fits his fellowship with thee. High thoughts had shaped the foolish brow, The coward had grasp'd the hero's sword, The vilest had been great, hadst thou, Just to thyself, been worth's reward. But lofty honours undersold Seller and buyer both disgrace; And favours that make folly bold Banish the light from virtue's face. II. _Love and Honour_. What man with baseness so content, Or sick with false conceit of right, As not to know that the element And inmost warmth of love's delight Is honour? Who'd not rather kiss A duchess than a milkmaid, prank The two in equal grace, which is Precedent Nature's obvious rank? Much rather, then, a woman deck'd With saintly honours, chaste and good, Whose thoughts celestial things affect, Whose eyes express her heavenly mood! Those lesser vaunts are dimm'd or lost Which plume her name or paint her lip, Extinct in the deep-glowing boast Of her angelic fellowship. III. _Valour Misdirected_. I'll hunt for dangers North and South, To prove my love, which sloth maligns!' What seems to say her rosy mouth? 'I'm not convinced by proofs but signs.' LOVE IN IDLENESS. 1 What should I do? In such a wife Fortune had lavish'd all her store, And nothing now seem'd left for life But to deserve her more and more. To this I vow'd my life's whole scope; And Love said, 'I forewarn you now, The Maiden will fulfill your hope Only as you fulfil your vow.' 2 A promised service, (task for days), Was done this morning while she slept, With that full heart which thinks no praise Of vows which are not more than kept; But loftier work did love impose. And studious hours. Alas, for these, While she from all my thoughts arose Like Venus from the restless seas! 3 I conn'd a scheme, within mind elate: My Uncle's land would fall to me, My skill was much in school debate, My friends were strong in Salisbury; A place in Parliament once gain'd, Thro' saps first labour'd out of sight, Far loftier peaks were then attain'd With easy leaps from height to height; And that o'erwhelming honour paid, Or recognised, at least, in life, Which this most sweet and noble Maid Should yield to him who call'd her Wife. 4 I fix'd this rule: in Sarum Close To make two visits every week, The first, to-day; and, save on those, I nought would do, think, read, or speak, Which did not help my settled will To earn the Statesman's proud applause. And now, forthwith, to mend my skill In ethics, politics, and laws, The Statesman's learning! Flush'd with power And pride of freshly-form'd resolve, I read Helvetius half-an-hour; But, halting in attempts to solve Why, more than all things else that be, A lady's grace hath force to move That sensitive appetency Of intellectual good, call'd love, Took Blackstone down, only to draw My swift-deriving thoughts ere long To love, which is the source of law, And, like a king, can do no wrong; Then open'd Hyde, where loyal hearts, With faith unpropp'd by precedent, Began to play rebellious parts. O, mighty stir that little meant! How dull the crude, plough'd fields of fact To me who trod the Elysian grove! How idle all heroic act By the least suffering of love! I could not read; so took my pen, And thus commenced, in form of notes, A Lecture for the Salisbury men, With due regard to Tory votes: 'A road's a road, though worn to ruts; They speed who travel straight therein; But he who tacks and tries short cuts Gets fools' praise and a broken shin—' And here I stopp'd in sheer despair; But, what to-day was thus begun, I vow'd, up starting from my chair, To-morrow should indeed be done; So loosed my chafing thoughts from school, To play with fancy as they chose, And then, according to my rule, I dress'd, and came to Sarum Close. 5 Ah, that sweet laugh! Diviner sense Did Nature, forming her, inspire To omit the grosser elements, And make her all of air and fire! 6 To-morrow, Cowes' Regatta fell: The Dean would like his girls to go, If I went too. 'Most gladly.' Well, I did but break a foolish vow! Unless Love's toil has love for prize, (And then he's Hercules), above All other contrarieties Is labour contrary to love. No fault of Love's, but nature's laws! And Love, in idleness, lies quick; For as the worm whose powers make pause, And swoon, through alteration sick, The soul, its wingless state dissolved, Awaits its nuptial life complete, All indolently self-convolved, Cocoon'd in silken fancies sweet. CANTO V. The Queen's Room. PRELUDES. I. _Rejected_. 'PERHAPS she's dancing somewhere now!' The thoughts of light and music wake Sharp jealousies, that grow and grow Till silence and the darkness ache. He sees her step, so proud and gay, Which, ere he spake, foretold despair: Thus did she look, on such a day, And such the fashion of her hair; And thus she stood, when, kneeling low, He took the bramble from her dress, And thus she laugh'd and talk'd, whose 'No' Was sweeter than another's 'Yes.' He feeds on thoughts that most deject; He impudently feigns her charms, So reverenced in his own respect, Dreadfully clasp'd by other arms; And turns, and puts his brows, that ache, Against the pillow where 'tis cold. If, only now his heart would break! But, oh, how much a heart can hold. II. _Rachel_. You loved her, and would lie all night Thinking how beautiful she was, And what to do for her delight. Now both are bound with alien laws! Be patient; put your heart to school; Weep if you will, but not despair; The trust that nought goes wrong by rule Should ease this load the many bear. Love, if there's heav'n, shall meet his dues, Though here unmatch'd, or match'd amiss; Meanwhile, the gentle cannot choose But learn to love the lips they kiss. Ne'er hurt the homely sister's ears With Rachel's beauties; secret be The lofty mind whose lonely tears Protest against mortality. III. _The Heart's Prophecies_. Be not amazed at life; 'tis still The mode of God with his elect Their hopes exactly to fulfil, In times and ways they least expect. THE QUEEN'S ROOM. 1 There's nothing happier than the days In which young Love makes every thought Pure as a bride's blush, when she says 'I will' unto she knows not what; And lovers, on the love-lit globe, For love's sweet sake, walk yet aloof, And hear Time weave the marriage-robe, Attraction warp and reverence woof. 2 My Housekeeper, my Nurse of yore, Cried, as the latest carriage went, 'Well, Mr, Felix, Sir, I'm sure The morning's gone off excellent! I never saw the show to pass The ladies, in their fine fresh gowns, So sweetly dancing on the grass, To music with its ups and downs. We'd such work, Sir, to clean the plate; 'Twas just the busy times of old. The Queen's Room, Sir, look'd quite like state. Miss Smythe, when she went up, made bold To peep into the Rose Boudoir, And cried, "How charming! all quite new;" And wonder'd who it could be for. All but Miss Honor look'd in too. But she's too proud to peep and pry. None's like that sweet Miss Honor, Sir! Excuse my humbleness, but I Pray Heav'n you'll get a wife like her! The Poor love dear Miss Honor's ways Better than money. Mrs. Rouse, Who ought to know a lady, says No finer goes to Wilton House. Miss Bagshaw thought that dreary room Had kill'd old Mrs. Vaughan with fright; She would not sleep in such a tomb For all her host was worth a night! Miss Fry, Sir, laugh'd; they talk'd the rest In French; and French Sir's Greek to me; But, though they smiled, and seem'd to jest, No love was lost, for I could see How serious-like Miss Honor was—' 'Well, Nurse, this is not my affair. The ladies talk'd in French with cause. Good-day; and thank you for your prayer.' 3 I loiter'd through the vacant house, Soon to be her's; in one room stay'd, Of old my mother's. Here my vows Of endless thanks were oftenest paid. This room its first condition kept; For, on her road to Sarum Town, Therein an English Queen had slept, Before the Hurst was half pull'd down. The pictured walls the place became: Here ran the Brook Anaurus, where Stout Jason bore the wrinkled dame Whom serving changed to Juno; there, Ixion's selfish hope, instead Of the nuptial goddess, clasp'd a cloud; And, here, translated Psyche fed Her gaze on Love, not disallow'd. 4 And in this chamber had she been, And into that she would not look, My Joy, my Vanity, my Queen, At whose dear name my pulses shook! To others how express at all My worship in that joyful shrine? I scarcely can myself recall What peace and ardour then were mine; And how more sweet than aught below, The daylight and its duties done, It felt to fold the hands, and so Relinquish all regards but one; To see her features in the dark, To lie and meditate once more The grace I did not fully mark, The tone I had not heard before; And from my pillow then to take Her notes, her picture, and her glove, Put there for joy when I should wake, And press them to the heart of love; And then to whisper 'Wife!' and pray To live so long as not to miss That unimaginable day Which farther seems the nearer 'tis; And still from joy's unfathom'd well To drink, in dreams, while on her brows Of innocence ineffable Blossom'd the laughing bridal rose. CANTO VI. The Love-Letters. PRELUDES. I. _Love's Perversity_. HOW strange a thing a lover seems To animals that do not love! Lo, where he walks and talks in dreams, And flouts us with his Lady's glove; How foreign is the garb he wears; And how his great devotion mocks Our poor propriety, and scares The undevout with paradox! His soul, through scorn of worldly care, And great extremes of sweet and gall, And musing much on all that's fair, Grows witty and fantastical; He sobs his joy and sings his grief, And evermore finds such delight In simply picturing his relief, That 'plaining seems to cure his plight; He makes his sorrow, when there's none; His fancy blows both cold and hot; Next to the wish that she'll be won, His first hope is that she may not; He sues, yet deprecates consent; Would she be captured she must fly; She looks too happy and content, For whose least pleasure he would die; Oh, cruelty, she cannot care For one to whom she's always kind! He says he's nought, but, oh, despair, If he's not Jove to her fond mind! He's jealous if she pets a dove, She must be his with all her soul; Yet 'tis a postulate in love That part is greater than the whole; And all his apprehension's stress, When he's with her, regards her hair, Her hand, a ribbon of her dress, As if his life were only there; Because she's constant, he will change, And kindest glances coldly meet, And, all the time he seems so strange, His soul is fawning at her feet; Of smiles and simple heaven grown tired, He wickedly provokes her tears, And when she weeps, as he desired, Falls slain with ecstasies of fears; He blames her, though she has no fault, Except the folly to be his; He worships her, the more to exalt The profanation of a kiss; Health's his disease, he's never well But when his paleness shames her rose; His faith's a rock-built citadel, Its sign a flag that each way blows; His o'erfed fancy frets and fumes; And Love, in him, is fierce, like Hate, And ruffles his ambrosial plumes Against the bars of time and fate. II. _The Power of Love_. Samson the Mighty, Solomon The Wise, and Holy David all Must doff their crowns to Love, for none But fell as Love would scorn to fall! And what may fallen spirits win, When stripes and precepts cannot move? Only the sadness of all sin, When look'd at in the light of Love. THE LOVE-LETTERS. 1 'You ask, Will admiration halt, Should spots appear within my Sun? Oh, how I wish I knew your fault, For Love's tired gaze to rest upon! Your graces, which have made me great, Will I so loftily admire, Yourself yourself shall emulate, And be yourself your own desire. I'll nobly mirror you too fair, And, when you're false to me your glass, What's wanting you'll by that repair, So bring yourself through me to pass. O dearest, tell me how to prove Goodwill which cannot be express'd; The beneficial heart of love Is labour in an idle breast. Name in the world your chosen part, And here I vow, with all the bent And application of my heart To give myself to your content. Would you live on, home-worshipp'd, thus, Not proudly high nor poorly low? Indeed the lines are fall'n to us In pleasant places! Be it so. But would you others heav'nward move, By sight not faith, while you they admire? I'll help with zeal as I approve That just and merciful desire. High as the lonely moon to view I'll lift your light; do you decree Your place, I'll win it; for from you Command inspires capacity. Or, unseen, would you sway the world More surely? Then in gracious rhyme I'll raise your emblem, fair unfurl'd With blessing in the breeze of time. Faith removes mountains, much more love; Let your contempt abolish me If ought of your devisal prove Too hard or high to do or be.' 2 I ended. 'From your Sweet-Heart, Sir,' Said Nurse, 'The Dean's man brings it down.' I could have kiss'd both him and her! 'Nurse, give him that, with half-a-crown.' How beat my heart, how paused my breath, When, with perversely fond delay, I broke the seal, that bore a wreath Of roses link'd with one of bay. 3 'I found your note. How very kind To leave it there! I cannot tell How pleased I was, or how you find Words to express your thoughts so well. The Girls are going to the Ball At Wilton. If you can, _do_ come; And any day this week you call Papa and I shall be at home. You said to Mary once—I hope In jest—that women _should_ be vain: On Saturday your friend (her Pope), The Bishop dined with us again. She put the question, if they ought? He turn'd it cleverly away (For giddy Mildred cried, she thought We _must_), with "What we must we may." 'Dear papa laugh'd, and said 'twas sad To think how vain his girls would be, Above all Mary, now she had Episcopal authority. But I was very dull, dear friend, And went upstairs at last, and cried. Be sure to come to-day, or send A rose-leaf kiss'd on either side. Adieu! I am not well. Last night My dreams were wild: I often woke, The summer-lightning was so bright; And when it flash'd I thought you spoke.' CANTO VII. The Revulsion. PRELUDES. I. _Joy and Use_. CAN ought compared with wedlock be For use? But He who made the heart To use proportions joy. What He Has join'd let no man put apart. Sweet Order has its draught of bliss Graced with the pearl of God's consent, Ten times delightful in that 'tis Considerate and innocent. In vain Disorder grasps the cup; The pleasure's not enjoy'd but spilt, And, if he stoops to lick it up, It only tastes of earth and guilt. His sorry raptures rest destroys; To live, like comets, they must roam; On settled poles turn solid joys, And sunlike pleasures shine at home. II. '_She was Mine_.' 'Thy tears o'erprize thy loss! Thy wife, In what was she particular? Others of comely face and life, Others as chaste and warm there are, And when they speak they seem to sing; Beyond her sex she was not wise; And there is no more common thing Than kindness in a woman's eyes. Then wherefore weep so long and fast, Why so exceedingly repine! Say, how has thy Beloved surpass'd So much all others?' 'She was mine.' THE REVULSION. 1 'Twas when the spousal time of May Hangs all the hedge with bridal wreaths, And air's so sweet the bosom gay Give thanks for every breath it breathes, When like to like is gladly moved, And each thing joins in Spring's refrain, 'Let those love now who never loved; Let those who have loved love again;' That I, in whom the sweet time wrought, Lay stretch'd within a lonely glade, Abandon'd to delicious thought Beneath the softly twinkling shade. The leaves, all stirring, mimick'd well A neighbouring rush of rivers cold, And, as the sun or shadow fell, So these were green and those were gold; In dim recesses hyacinths droop'd, And breadths of primrose lit the air, Which, wandering through the woodland, stoop'd And gather'd perfumes here and there; Upon the spray the squirrel swung, And careless songsters, six or seven. Sang lofty songs the leaves among, Fit for their only listener, Heaven. I sigh'd, 'Immeasurable bliss Gains nothing by becoming more! Millions have meaning; after this Cyphers forget the integer.' 2 And so I mused, till musing brought A dream that shook my house of clay, And, in my humbled heart, I thought, To me there yet may come a day With this the single vestige seen Of comfort, earthly or divine, My sorrow some time must have been Her portion, had it not been mine. Then I, who knew, from watching life, That blows foreseen are slow to fall, Rehearsed the losing of a wife, And faced its terrors each and all. The self-chastising fancy show'd The coffin with its ghastly breath; The innocent sweet face that owed None of its innocence to death; The lips that used to laugh; the knell That bade the world beware of mirth; The heartless and intolerable Indignity of 'earth to earth;' At morn remembering by degrees That she I dream'd about was dead; Love's still recurrent jubilees, The days that she was born, won, wed; The duties of my life the same, Their meaning for the feelings gone; Friendship impertinent, and fame Disgusting; and, more harrowing none, Small household troubles fall'n to me, As, 'What time would I dine to-day?' And, oh, how could I bear to see The noisy children at their play. Besides, where all things limp and halt, Could I go straight, should I alone Have kept my love without default, Pitch'd at the true and heavenly tone? The festal-day might come to mind That miss'd the gift which more endears; The hour which might have been more kind, And now less fertile in vain tears; The good of common intercourse, For daintier pleasures, then despised, Now with what passionate remorse, What poignancy of hunger prized! The little wrong, now greatly rued, Which no repentance now could right; And love, in disbelieving mood, Deserting his celestial height. Withal to know, God's love sent grief To make me less the world's, and more Meek-hearted: ah, the sick relief! Why bow'd I not my heart before? 3 'What,' I exclaimed, with chill alarm, 'If this fantastic horror shows The feature of an actual harm!' And, coming straight to Sarum Close, As one who dreams his wife is dead, And cannot in his slumber weep, And moans upon his wretched bed, And wakes, and finds her there asleep, And laughs and sighs, so I, not less Relieved, beheld, with blissful start, The light and happy loveliness Which lay so heavy on my heart. CANTO VIII. The Koh-i-noor. PRELUDES. I. _In Love_. IF he's capricious she'll be so, But, if his duties constant are, She lets her loving favour glow As steady as a tropic star; Appears there nought for which to weep, She'll weep for nought, for his dear sake; She clasps her sister in her sleep; Her love in dreams is most awake. Her soul, that once with pleasure shook, Did any eyes her beauty own, Now wonders how they dare to look On what belongs to him alone; The indignity of taking gifts Exhilarates her loving breast; A rapture of submission lifts Her life into celestial rest; There's nothing left of what she was; Back to the babe the woman dies, And all the wisdom that she has Is to love him for being wise. She's confident because she fears; And, though discreet when he's away, If none but her dear despot hears, She prattles like a child at play. Perchance, when all her praise is said, He tells the news, a battle won, On either side ten thousand dead. 'Alas!' she says; but, if 'twere known, She thinks, 'He's looking on my face! I am his joy; whate'er I do, He sees such time-contenting grace In that, he'd have me always so!' And, evermore, for either's sake, To the sweet folly of the dove, She joins the cunning of the snake, To rivet and exalt his love; Her mode of candour is deceit; And what she thinks from what she'll say (Although I'll never call her cheat), Lies far as Scotland from Cathay. Without his knowledge he was won; Against his nature kept devout; She'll never tell him how 'twas done, And he will never find it out. If, sudden, he suspects her wiles, And hears her forging chain and trap, And looks, she sits in simple smiles, Her two hands lying in her lap. Her secret (privilege of the Bard, Whose fancy is of either sex), Is mine; but let the darkness guard Myst'ries that light would more perplex! II. _Love Thinking_. What lifts her in my thought so far Beyond all else? Let Love not err! 'Tis that which all right women are, But which I'll know in none but her. She is to me the only Ark Of that high mystery which locks The lips of joy, or speaks in dark Enigmas and in paradox; That potent charm, which none can fly, Nor would, which makes me bond and free, Nor can I tell if first 'twas I Chose it, or it elected me; Which, when I look intentest, lo, Cheats most mine eyes, albeit my heart, Content to feel and not to know, Perceives it all in every part; I kiss its cheek; its life divine Exhales from its resplendent shroud; Ixion's fate reversed is mine, Authentic Juno seems a cloud; I feel a blessed warmth, I see A bright circumference of rays, But darkness, where the sun should be, Fills admiration with amaze; And when, for joy's relief, I think To fathom with the line of thought The well from which I, blissful, drink, The spring's so deep I come to nought. III. _The Kiss_. 'I saw you take his kiss!' ''Tis true.' 'O, modesty!' ''Twas strictly kept: He thought me asleep; at least, I knew He thought I thought he thought I slept.' THE KOH-I-NOOR. 1 'Be man's hard virtues highly wrought, But let my gentle Mistress be, In every look, word, deed, and thought, Nothing but sweet and womanly! Her virtues please my virtuous mood, But what at all times I admire Is, not that she is wise or good, But just the thing which I desire. With versatility to sing The theme of love to any strain, If oft'nest she is anything, Be it careless, talkative, and vain. That seems in her supremest grace Which, virtue or not, apprises me That my familiar thoughts embrace Unfathomable mystery.' 2 I answer'd thus; for she desired To know what mind I most approved; Partly to learn what she inquired, Partly to get the praise she loved. 3 I praised her, but no praise could fill The depths of her desire to please, Though dull to others as a Will To them that have no legacies. The more I praised the more she shone, Her eyes incredulously bright, And all her happy beauty blown Beneath the beams of my delight. Sweet rivalry was thus begot; By turns, my speech, in passion's style, With flatteries the truth o'ershot, And she surpass'd them with her smile. 4 'You have my heart so sweetly seiz'd, And I confess, nay, 'tis my pride That I'm with you so solely pleased, That, if I'm pleased with aught beside, As music, or the month of June, My friend's devotion, or his wit, A rose, a rainbow, or the moon, It is that you illustrate it. All these are parts, you are the whole; You fit the taste for Paradise, To which your charms draw up the soul As turning spirals draw the eyes. Nature to you was more than kind; 'Twas fond perversity to dress So much simplicity of mind In such a pomp of loveliness! But, praising you, the fancy deft Flies wide, and lets the quarry stray, And, when all's said, there's something left, And that's the thing I meant to say.' 'Dear Felix!' 'Sweet, my Love!' But there Was Aunt Maude's noisy ring and knock! 'Stay, Felix; you have caught my hair. Stoop! Thank you!' 'May I have that lock?' 'Not now. Good morning, Aunt!' 'Why, Puss, You look magnificent to-day.' 'Here's Felix, Aunt.' 'Fox and green goose! Who handsome gets should handsome pay! Aunt, you are friends!' 'Ah, to be sure! Good morning! Go on flattering, sir; A woman, like the Koh-i-noor, Mounts to the price that's put on her.' CANTO IX. The Friends. PRELUDES. I. _The Nursling of Civility_. LO, how the woman once was woo'd; Forth leapt the savage from his lair, And fell'd her, and to nuptials rude He dragg'd her, bleeding, by the hair. From that to Chloe's dainty wiles And Portia's dignified consent, What distance! Bat these Pagan styles How far below Time's fair intent! Siegfried sued Kriemhild. Sweeter life Could Love's self covet? Yet 'tis snug In what rough sort he chid his wife For want of curb upon her tongue! Shall Love, where last I leave him, halt? Nay; none can fancy or forsee To how strange bliss may time exalt This nursling of civility. II. _The Foreign Land_. A woman is a foreign land, Of which, though there he settle young, A man will ne'er quite understand The customs, politics, and tongue. The foolish hie them post-haste through, See fashions odd, and prospects fair, Learn of the language, 'How d'ye do,' And go and brag they have been there. The most for leave to trade apply, For once, at Empire's seat, her heart, Then get what knowledge ear and eye Glean chancewise in the life-long mart. And certain others, few and fit, Attach them to the Court, and see The Country's best, its accent hit, And partly sound its polity. III. _Disappointment_. 'The bliss which woman's charms bespeak, I've sought in many, found in none!' 'In many 'tis in vain you seek What only can be found in one.' THE FRIENDS. 1 Frank's long, dull letter, lying by The gay sash from Honoria's waist, Reproach'd me; passion spared a sigh For friendship without fault disgraced. How should I greet him? how pretend I felt the love he once inspired? Time was when either, in his friend, His own deserts with joy admired; We took one side in school-debate, Like hopes pursued with equal thirst, Were even-bracketed by Fate, Twin-Wranglers, seventh from the First; And either loved a lady's laugh More than all music; he and I Were perfect in the pleasant half Of universal charity. 2 From pride of likeness thus I loved Him, and he me, till love begot The lowliness which now approved Nothing but that which I was not, Blest was the pride of feeling so Subjected to a girl's soft reign. She was my vanity, and, oh, All other vanities how vain! 3 Frank follow'd in his letter's track, And set my guilty heart at ease By echoing my excuses back With just the same apologies. So he had slighted me as well! Nor was my mind disburthen'd less When what I sought excuse to tell He of himself did first confess. 4 Each, rapturous, praised his lady's worth; He eloquently thus: 'Her face Is the summ'd sweetness of the earth, Her soul the glass of heaven's grace, To which she leads me by the hand; Or, briefly all the truth to say To you, who briefly understand, She is both heaven and the way. Displeasures and resentments pass Athwart her charitable eyes More fleetingly than breath from glass, Or truth from foolish memories; Her heart's so touch'd with others' woes She has no need of chastisement; Her gentle life's conditions close, Like God's commandments, with content, And make an aspect calm and gay, Where sweet affections come and go, Till all who see her, smile and say, How fair, and happy that she's so! She is so lovely, true, and pure, Her virtue virtue so endears, That often, when I think of her, Life's meanness fills mine eyes with tears—' 'You paint Miss Churchill! Pray go on—' 'She's perfect, and, if joy was much To think her nature's paragon, 'Tis more that there's another such!' 5 Praising and paying back their praise With rapturous hearts, t'ward Sarum Spire We walk'd, in evening's golden haze, Friendship from passion stealing fire. In joy's crown danced the feather jest, And, parting by the Deanery door, Clasp'd hands, less shy than words, confess'd We had not been true friends before. CANTO X. The Epitaph. PRELUDES. I. _Frost in Harvest_. THE lover who, across a gulf Of ceremony, views his Love, And dares not yet address herself, Pays worship to her stolen glove. The gulf o'erleapt, the lover wed, It happens oft, (let truth be told), The halo leaves the sacred head, Respect grows lax, and worship cold, And all love's May-day promising, Like song of birds before they pair, Or flush of flowers in boastful Spring, Dies out, and leaves the Summer bare. Yet should a man, it seems to me, Honour what honourable is, For some more honourable plea Than only that it is not his. The gentle wife, who decks his board And makes his day to have no night, Whose wishes wait upon her lord, Who finds her own in his delight, Is she another now than she Who, mistress of her maiden charms, At his wild prayer, incredibly Committed them to his proud arms? Unless her choice of him's a slur Which makes her proper credit dim, He never enough can honour her Who past all speech has honour'd him. II. _Felicity_. To marry her and take her home! The poet, painting pureness, tells Of lilies; figures power by Rome; And each thing shows by something else. But through the songs of poets look, And who so lucky to have found In universal nature's book A likeness for a life so crown'd! Here they speak best who best express Their inability to speak, And none are strong, but who confess With happy skill that they are weak. III. _Marriage Indissoluble_. 'In heaven none marry.' Grant the most Which may by this dark word be meant, Who shall forbid the eternal boast 'I kiss'd, and kiss'd with her consent!' If here, to Love, past favour is A present boast, delight, and chain, What lacks of honour, bond, and bliss, Where Now and Then are no more twain! THE EPITAPH. 1 'At Church, in twelve hours more, we meet! This, Dearest, is our last farewell.' 'Oh, Felix, do you love me?' 'Sweet, Why do you ask?' 'I cannot tell.' 2 And was it no vain fantasy That raised me from the earth with pride? Should I to-morrow verily Be Bridegroom, and Honoria Bride? Should I, in simple fact, henceforth Live unconditionally lord Of her whose smile for brightest worth Seem'd all too bountiful reward? Incredible life's promise seem'd, Or, credible, for life too great; Love his own deity blasphemed, And doff'd at last his heavenly state. What law, if man could mount so high, To further insolence set bars, And kept the chaste moon in the sky, And bade him not tread out the stars! 3 Patience and hope had parted truce, And, sun-like, Love obscured his ray With dazzling mists, driven up profuse Before his own triumphant way. I thought with prayer how Jacob paid The patient price of Rachel; them, Of that calm grace Tobias said, And Sarah's innocent 'Amen.' Without avail! O'erwhelming wealth, The wondrous gift of God so near, Which should have been delight and health Made heart and spirit sick and sere. Until at last the soul of love, That recks not of its own delight, Awoke and bade the mists remove, And then once more I breathed aright; And I rehears'd my marriage vow, And swore her welfare to prefer To all things, and for aye as now To live, not for myself, but her. Forth, from the glittering spirit's peace And gaiety ineffable, Stream'd to the heart delight and ease, As from an overflowing well; And, orderly deriving thence Its pleasure perfect and allow'd, Bright with the spirit shone the sense, As with the sun a fleecy cloud. If now to part with her could make Her pleasure greater, sorrow less, I for my epitaph would take 'To serve seem'd more than to possess.' And I perceiv'd, (the vision sweet Dimming with happy dew mine eyes), That love and joy are torches lit From altar-fires of sacrifice. 4 Across the sky the daylight crept, And birds grew garrulous in the grove, And on my marriage-morn I slept A soft sleep, undisturb'd by love. CANTO XI. The Wedding. PRELUDES. I. _Platonic Love_. RIGHT art thou who wouldst rather be A doorkeeper in Love's fair house, Than lead the wretched revelry Where fools at swinish troughs carouse. But do not boast of being least; And if to kiss thy Mistress' skirt Amaze thy brain, scorn not the Priest Whom greater honours do not hurt. Stand off and gaze, if more than this Be more than thou canst understand, Revering him whose power of bliss, Angelic, dares to seize her hand, Or whose seraphic love makes flight To the apprehension of her lips; And think, the sun of such delight From thine own darkness takes eclipse. And, wouldst thou to the same aspire, This is the art thou must employ, Live greatly; so shalt thou acquire Unknown capacities of joy. II. _A Demonstration_. Nature, with endless being rife, Parts each thing into 'him' and 'her,' And, in the arithmetic of life, The smallest unit is a pair; And thus, oh, strange, sweet half of me, If I confess a loftier flame, If more I love high Heaven than thee, I more than love thee, thine I am; And, if the world's not built of lies, Nor all a cheat the Gospel tells, If that which from the dead shall rise Be I indeed, not something else, There's no position more secure In reason or in faith than this, That those conditions must endure, Which, wanting, I myself should miss. III. _The Symbol_. As if I chafed the sparks from glass, And said, 'It lightens,' hitherto The songs I've made of love may pass For all but for proportion true; But likeness and proportion both Now fail, as if a child in glee, Catching the flakes of the salt froth, Cried, 'Look, my mother, here's the sea. Yet, by the help of what's so weak, But not diverse, to those who know, And only unto those I speak, May far-inferring fancy show Love's living sea by coasts uncurb'd, Its depth, its mystery, and its might, Its indignation if disturb'd, The glittering peace of its delight. IV. _Constancy Rewarded_. I vow'd unvarying faith, and she, To whom in full I pay that vow, Rewards me with variety Which men who change can never know. THE WEDDING. 1 Life smitten with a feverish chill, The brain too tired to understand, In apathy of heart and will, I took the woman from the hand Of him who stood for God, and heard Of Christ, and of the Church his Bride; The Feast, by presence of the Lord And his first Wonder, beautified; The mystic sense to Christian men; The bonds in innocency made, And gravely to be enter'd then, For children, godliness, and, aid, And honour'd, and kept free from smirch; And how a man must love his wife No less than Christ did love his Church, If need be, giving her his life; And, vowing then the mutual vow, The tongue spoke, but intention slept. 'Tis well for us Heaven asks not how We take this oath, but how 'tis kept. 2 O, bold seal of a bashful bound, Which makes the marriage-day to be, To those before it and beyond, An iceberg in an Indian sea! 3 'Now, while she's changing,' said the Dean, 'Her bridal for her travelling dress, I'll preach allegiance to your queen! Preaching's the thing which I profess; And one more minute's mine! You know I've paid my girl a father's debt, And this last charge is all I owe. She's yours; but I love more than yet You can; such fondness only wakes When time has raised the heart above The prejudice of youth, which makes Beauty conditional to love. Prepare to meet the weak alarms Of novel nearness; recollect The eye which magnified her charms Is microscopic for defect. Fear comes at first; but soon, rejoiced, You'll find your strong and tender loves, Like holy rocks by Druids poised, The least force shakes, but none removes. Her strength is your esteem; beware Of finding fault; her will's unnerv'd By blame; from you 'twould be despair; But praise that is not quite deserv'd Will all her noble nature move To make your utmost wishes tree. Yet think, while mending thus your Love, Of snatching her ideal too. The death of nuptial joy is sloth: To keep your mistress in your wife, Keep to the very height your oath, And honour her with arduous life. Lastly, no personal reverence doff. Life's all externals unto those Who pluck the blushing petals off, To find the secret of the rose.— How long she's tarrying! Green's Hotel I'm sure you'll like. The charge is fair, The wines good. I remember well I stay'd once, with her Mother, there. A tender conscience of her vow That Mother had! She's so like her!' But Mrs. Fife, much flurried, now Whisper'd, 'Miss Honor's ready, Sir.' 4 Whirl'd off at last, for speech I sought, To keep shy Love in countenance, But, whilst I vainly tax'd my thought, Her voice deliver'd mime from trance: 'Look, is not this a pretty shawl, Aunt's parting gift.' 'She's always kind.' 'The new wing spoils Sir John's old Hall: You'll see it, if you pull the blind.' 5 I drew the silk: in heaven the night Was dawning; lovely Venus shone, In languishment of tearful light, Swathed by the red breath of the sun. CANTO XII. Husband and Wife. PRELUDES. I. _The Married Lover_. WHY, having won her, do I woo? Because her spirit's vestal grace Provokes me always to pursue, But, spirit-like, eludes embrace; Because her womanhood is such That, as on court-days subjects kiss The Queen's hand, yet so near a touch Affirms no mean familiarness, Nay, rather marks more fair the height Which can with safety so neglect To dread, as lower ladies might, That grace could meet with disrespect, Thus she with happy favour feeds Allegiance from a love so high That thence no false conceit proceeds Of difference bridged, or state put by; Because, although in act and word As lowly as a wife can be, Her manners, when they call me lord, Remind me 'tis by courtesy; Not with her least consent of will, Which would my proud affection hurt, But by the noble style that still Imputes an unattain'd desert; Because her gay and lofty brows, When all is won which hope can ask, Reflect a light of hopeless snows That bright in virgin ether bask; Because, though free of the outer court I am, this Temple keeps its shrine Sacred to Heaven; because, in short, She's not and never can be mine. II. _The Amaranth_. Feasts satiate; stars distress with height; Friendship means well, but misses reach, And wearies in its best delight, Vex'd with the vanities of speech; Too long regarded, roses even Afflict the mind with fond unrest; And to converse direct within Heaven Is oft a labour in the breast; Whate'er the up-looking soul admires, Whate'er the senses' banquet be, Fatigues at last with vain desires, Or sickens by satiety; But truly my delight was more In her to whom I'm bound for aye Yesterday than the day before And more to-day than yesterday. HUSBAND AND WIFE. 1 I, while the shop-girl fitted on The sand-shoes, look'd where, down the bay, The sea glow'd with a shrouded sun. 'I'm ready, Felix; will you pay?' That was my first expense for this Sweet Stranger, now my three days' Wife. How light the touches are that kiss The music from the chords of life! 2 Her feet, by half-a-mile of sea, In spotless sand left shapely prints; With agates, then, she loaded me; (The lapidary call'd them flints); Then, at her wish, I hail'd a boat, To take her to the ships-of-war, At anchor, each a lazy mote Black in the brilliance, miles from shore. 3 The morning breeze the canvas fill'd, Lifting us o'er the bright-ridged gulf, And every lurch my darling thrill'd With light fear smiling at itself; And, dashing past the Arrogant, Asleep upon the restless wave After its cruise in the Levant, We reach'd the Wolf, and signal gave For help to board; within caution meet, My bride was placed within the chair, The red flag wrapp'd about her feet, And so swung laughing through the air. 4 'Look, Love,' she said, 'there's Frederick Graham, My cousin, whom you met, you know,' And seeing us, the brave man came, And made his frank and courteous bow, And gave my hand a sailor's shake, And said, 'You ask'd me to the Hurst: I never thought my luck would make Your wife and you my guests the first.' And Honor, cruel, 'Nor did we: Have you not lately changed your ship?' 'Yes: I'm Commander, now,' said he, With a slight quiver of the lip. We saw the vessel, shown with pride; Took luncheon; I must eat his salt! Parting he said, (I fear my bride Found him unselfish to a fault), His wish, he saw, had come to pass, (And so, indeed, her face express'd), That that should be, whatever 'twas, Which made his Cousin happiest. We left him looking from above; Rich bankrupt! for he could afford To say most proudly that his love Was virtue and its own reward. But others loved as well as he, (Thought I, half-anger'd), and if fate, Unfair, had only fashion'd me As hapless, I had been as great. 5 As souls, ambitious, but low-born, If raised past hope by luck or wit, All pride of place will proudly scorn, And live as they'd been used to it, So we two wore our strange estate: Familiar, unaffected, free, We talk'd, until the dusk grew late, Of this and that; but, after tea, As doubtful if a lot so sweet As ours was ours in very sooth, Like children, to promote conceit, We feign'd that it was not the truth; And she assumed the maiden coy, And I adored remorseless charms, And then we clapp'd our hands for joy, And ran into each others arms. THE EPILOGUE. I 'AH, dearest Wife, a fresh-lit fire Sends forth to heaven great shows of fume, And watchers, far away, admire; But when the flames their power assume, The more they burn the less they show, The clouds no longer smirch the sky, And then the flames intensest glow When far-off watchers think they die. The fumes of early love my verse Has figured—' 'You must paint the flame!' 'Twould merit the Promethean curse! But now, Sweet, for your praise and blame.' 'You speak too boldly; veils are due To women's feelings.' 'Fear not this! Women will vow I say not true, And men believe thine lips they kiss.' I did not call you "Dear" or "Love," 'I think, till after Frank was born.' 'That fault I cannot well remove; The rhymes'—but Frank now blew his horn, And Walter bark'd, on hands and knees, At Baby in the mignonette, And all made, full-cry, for the trees Where Felix and his Wife were set. Again disturb'd, (crickets have cares!) True to their annual use they rose, To offer thanks at Evening Prayers In three times sacred Sarum Close. 2 Passing, they left a gift of wine At Widow Neale's. Her daughter said: 'O, Ma'am, she's sinking! For a sign, She cried just now, of him that's dead, "Mary, he's somewhere close above, Weeping and wailing his dead wife, With forceful prayers and fatal love Conjuring me to come to life. A spirit is terrible though dear! It comes by night, and sucks my breath, And draws me with desire and fear." Ah, Ma'am, she'll soon be his in death!' 3 Vaughan, when his kind Wife's eyes were dry, Said, 'This thought crosses me, my Dove; If Heaven should proffer, when we die, Some unconceiv'd, superior love, How take the exchange without despair, Without worse folly how refuse?' But she, who, wise as she was fair, For subtle doubts had simple clues, Said, 'Custom sanctifies, and faith Is more than joy: ah, how desire In any heaven a different path, Though, found at first, it had been higher? Yet love makes death a dreadful thought! Felix, at what a price we live!' But present pleasures soon forgot The future's dread alternative; For, as became the festal time, He cheer'd her heart with tender praise, And speeches wanting only rhyme To make them like his winged lays. He discommended girlhood. 'What For sweetness like the ten-years' wife, Whose customary love is not Her passion, or her play, but life? With beauties so maturely fair, Affecting, mild, and manifold, May girlish charms mo more compare Than apples green with apples gold. Ah, still unpraised Honoria, Heaven, When you into my arms it gave, Left nought hereafter to be given But grace to feel the good I have.' 4 Her own and manhood's modesty Made dumb her love, but, on their road, His hand in hers felt soft reply, And like rejoinder found bestow'd; And, when the carriage set them down, 'How strange,' said he, ''twould seem to meet, When pacing, as we now this town, A Florence or a Lisbon Street, That Laura or that Catherine, who, In the remote, romantic years, From Petrarch or Camoens drew Their songs and their immortal tears!' But here their converse had its end; For, crossing the Cathedral Lawn, There came an ancient college-friend, Who, introduced to Mrs. Vaughan, Lifted his hat, and bow'd and smiled. And fill'd her kind large eyes with joy, By patting on the cheek her child, With, 'Is he yours, this handsome boy?' * * * * * * * * * * Printed by Cassell & Company, Limited, La Bella Sauvage, London, E.C. 18–491 ***
{ "redpajama_set_name": "RedPajamaBook" }
6,857
\section{Introduction} The problem of scaling an entrywise nonnegative $m\times n$ matrix $A$ with diagonal transformations and prespecified vectors $r$ and $c$ for the row and column sums, respectively, consists of finding a matrix of the form $S = D_{\ell}A D_r$, where $D_{\ell}\in\mathbb{R}^{m\times m}$ and $D_{r}\in\mathbb{R}^{n\times n}$ are diagonal matrices having positive diagonal elements, and such that \begin{equation}\label{RS_problem} S{\mathbf{1}}_n=r\quad \text{ and }\quad {\mathbf{1}}_m^{T}S=c^{T}, \end{equation} where ${\mathbf{1}}_i:=[1,\ldots,1]^{T}\in\mathbb{R}^{i}$ for $i=n,m$ \cite{Brualdi66,RoSc}. When $r={\mathbf{1}}_m$ and $c={\mathbf{1}}_n$ the scaled matrix $S$ is \cblu{neccessarily square and is} said to be doubly stochastic, i.e., its row and column sums are all equal to $1$. The related problem of scaling the rows and columns of a complex square matrix $A$ (not necessarily nonnegative) using real and positive diagonal similarity transformations in order to compute more accurate eigenvalues, is a well established technique to improve the sensitivity of the eigenvalue problem of the matrix $A$ \cite{Par}. \cblu{This is known as {\em balancing} the matrix $A$. In exact arithmetic, it amounts to minimizing the Frobenius norm of the scaled matrix $D^{-1}AD$, where $D$ ranges over all non-singular real diagonal matrices, which is equivalent to minimizing the departure from normality of $D^{-1}AD$ \cite{LemVD}. Since the eigenvalues of normal matrices have condition numbers equal to $1$, such scaling very often improves the sensitivity of eigenvalues}. The method for computing the optimal scaling is a very simple cyclic procedure where at each step only a single diagonal element of $D$ is updated. This method is implemented in MATLAB \cite{Matlab} as a default option of the eigenvalue computation problem, which indicates that its effectiveness is well accepted. For improving the accuracy of the eigenvalues computed in floating point arithmetic, it is essential that the diagonal elements of $D$ are integer powers of $2$, because in this way the scaling does not produce any rounding errors and the eigenvalues are preserved {\em exactly} under such a scaling transformation. Otherwise, the rounding errors inherent to constructing $D^{-1}AD$ would spoil any potential improvement in the accuracy of the computed eigenvalues. As explained in \cite{Par}, the restriction to diagonal matrices $D$ whose entries are integer powers of $2$ allows for a relaxed stopping criterion of the cyclic procedure for computing $D$ and implies that the related minimization problem is only approximately solved. The idea of performing positive diagonal scalings in order to improve the \cblu{accuracy of computed} eigenvalues was also extended to the generalized eigenvalue problem of a regular pencil $\lambda B-A$. In this case, the nonsingular diagonal matrices multiplying the pencil on the left and on the right are different. In \cite{Ward}, Ward describes a scaling technique which aims at making the pencil entries have magnitudes as close to unity as possible. \cblu{In \cite{LemVD}, Lemonnier and Van Dooren propose a diagonal scaling that in exact arithmetic minimizes the Frobenius norm of the pencils over all positive diagonal scalings with fixed determinant. This improves very often the conditioning of the eigenvalues, since the solution of such minimization problem over general nonsingular transformations is a so-called standardized normal pencil, which is a pencil whose eigenvalues all have a condition number in the chordal metric that is smaller than or equal to $\sqrt{2}$. The method of Ward is the one that LAPACK \cite{lapack} proposes as built-in option for scaling a regular pencil, but it was pointed out in \cite{LemVD} that the method of Lemonnier-Van Dooren outperforms that of Ward in terms of the accuracy of the computed eigenvalues, especially when the pencil has entries of strongly varying magnitudes. The experiments in Section \ref{sec:numerics} will further confirm the superiority of the method in \cite{LemVD} for a wide variety of pencils of different sizes and types. As in the case of balancing matrices, it is essential that the entries of the diagonal scaling matrices are integer powers of $2$ in order to improve the accuracy of the computed eigenvalues in floating point arithmetic. Currently, MATLAB does not offer any built-in option for scaling pencils. We will see in Section \ref{sec:regular} that the method in \cite{LemVD} is equivalent to scaling a particular nonnegative matrix to a multiple of a doubly stochastic matrix, which motivates us to revise briefly the literature on this and other related problems. There is a vast literature on diagonal scaling of nonnegative matrices for getting a matrix with prescribed row and column sums. The origin of these problems goes back at least until the beginning of the XX century \cite{kruithof37,yule2012} and originates in the area of optimal transport \cite{CuturiPeyre}, though it has applications in many other areas \cite{Idel}. See \cite[Section 3.1]{Idel} and \cite[Remark 4.5]{CuturiPeyre} for historical remarks on these problems. Relevant classical references from the point of view of matrix analysis include \cite{Brualdi66,Krupp,RoSc,SiK}, among many others. Despite this vast literature, several issues are still open for improvement, such as a good understanding of the convergence of related algorithms for sparse matrices and simple conditions on the zero pattern of the matrix for existence and unicity of a solution for special cases, specially in the case of rectangular matrices \cite{Idel}. The most relevant papers on diagonal scalings that are closely related to the problems discussed in this paper are, in chronological order, those of Sinkhorn-Knopp \cite{SiK}, Krupp \cite{Krupp}, Rothblum-Schneider \cite{RoSc} and Knight \cite{Knight}, which is why we quote theorems from those papers. In this paper we show that there exists a link between the problem of scaling a regular square pencil and that of scaling a square nonnegative matrix to become doubly stochastic. This implies that the scaling is essentially unique and bounded if and only if the corresponding nonnegative matrix satisfies certain conditions, namely {\em total support} and {\em full indecomposability}.} Moreover, in that situation, the scaling can be found through the well-known Sinkhorn-Knopp algorithm \cite{Knight,SiK}. We then show how to extend this to singular or nonsquare pencils, which, to the best of our knowledge, has not been considered yet in the literature. For that, we introduce a regularization term into the original problem which ensures existence of a solution of an approximate problem with bounded diagonal scalings $D_\ell$ and $D_r$. In addition, the regularization term can be considered in both square or nonsquare cases. These ideas are connected to the results of Rothblum and Schneider \cite{RoSc} about \cblu{scaling arbitrary nonnegative matrices (square or rectangular) with} prespecified row and column sums,\cblu{ which can be obtained using a Sinkhorn-Knopp-like algorithm, but many other optimization methods have been proposed in the literature \cite{Idel,CuturiPeyre}.} We then build on these ideas to further improve the scaling technique of Lemonnier and Van Dooren by introducing the regularization term as an additional cost. This cost can be viewed as a regularization to ensure \cblu{always the} existence and boundedness of our scaling, but it also ensures essential unicity of the computed scaling. The paper is organized as follows. In Section \ref{sec:scaling}, we give some basic notions about scaling pencils\cblu{, scaling nonnegative matrices and the Sinkhorn-Knopp-like algorithm}. In Sections \ref{sec:regular} and \ref{sec:nonsquare}, we study the diagonal scaling problem for square and nonsquare pencils, respectively. In Section \ref{sec:regular}, we will also recall the necessary and sufficient conditions for a square \cblu{nonnegative} matrix to become doubly stochastic under diagonal scalings, and we give \cblu{simple sufficient conditions based on the zero pattern of the matrix} for the existence of diagonal scalings having any prespecified common vector for the row and column sums. These results will be useful in Section \ref{sec:regularized}. In that section, we develop a new scaling technique for generalized eigenvalue problems and show that it can be applied to any pencil, regular or singular, square or rectangular. For that, we introduce a regularization term into the original problem which guarantees existence, unicity and boundedness of the scaling. In addition, in Subsection \ref{sec:regularized_rowandcolum}, we consider a modified version of the new scaling technique that is \cblu{often} better for scaling nonsquare pencils. In Section \ref{sec:numerics} we then illustrate the improved accuracy of the computed eigenvalues using several numerical examples. In the last Section \ref{sec:conclusion} we give some concluding remarks. \section{Preliminaries: \cblu{Scaling arbitrary pencils and nonnegative matrices}} \label{sec:scaling} The standard techniques for computing eigenvalues of complex pencils of matrices guarantee that the backward errors corresponding to the computed spectrum are essentially bounded by the norm of the coefficients of the pencil, times the machine precision of the computer used. But one can improve this bound by reducing the norms of the coefficients without affecting the spectrum. This is where balancing using diagonal scaling comes in. \cblu{We emphasize again that the diagonal entries of such scalings must be integer powers of $2$, since otherwise the rounding errors of floating point arithmetic would destroy any potential improvement in accuracy that such scalings might achieve.} Two types of scalings can be applied to a pencil $\lambda B-A$. The first one is a change of variable $\hat \lambda := d_{\lambda}\lambda$ to make sure that the scaled matrices $A$ and $B/d_{\lambda}$ have approximately the same norm. This can be done without introducing rounding errors, by taking $d_\lambda$ equal to a power of 2. The staircase and the $QZ$ algorithm work independently on both matrices and this scaling can be restored afterwards, again without introducing any additional errors. One could therefore argue that this scaling is irrelevant for these algorithms, but we will see that it affects the second scaling procedure we will discuss. Therefore we will assume in the sequel that both matrices $A$ and $B$ are of comparable norms, and that no such variable scaling needs to be applied. The second type of scaling is based on multiplication on the left and on the right by positive diagonal matrices $D_\ell$ and $D_r$, respectively, that are chosen to ``balance'' in some sense the row and column norms of the complex matrices $\widetilde{A}:=D_\ell A D_r$ and $\widetilde{B}:=D_\ell B D_r$. We will see that balancing the row and column norms of the matrices $\widetilde{A}$ and $\widetilde{B}$ is equivalent to performing two-sided diagonal scalings to a particular real entrywise nonnegative matrix $M$. Therefore, we recall in the sequel some results on this problem. The first result we revise appears in \cite[Theorem 2, (a)-(b)]{RoSc} and is the next one. \begin{theorem} \label{thm.RS2ab} Given a real nonnegative matrix $M\in \mathbb{R}^{m\times n}$ and vectors $r\in \mathbb{R}^{m\times 1}$ and $c\in \mathbb{R}^{n\times 1}$ with strictly positive entries satisfying ${\mathbf{1}}_m^Tr=c^T{\mathbf{1}}_n$, there exist positive diagonal matrices $D_{M,\ell}$ and $D_{M,r}$ such that \begin{equation}\label{eq:RS_prob} D_{M,\ell} M D_{M,r} {\mathbf{1}}_n = r\quad \text{ and }\quad {\mathbf{1}}_m^T D_{M,\ell} M D_{M,r} = c^T \end{equation} if and only if there exists a matrix $S$ with the same zero pattern as $M$ such that $S{\mathbf{1}}_n=r$ and ${\mathbf{1}}_m^TS=c^T$. \end{theorem} This is an elegant nontrivial existence result that in a less general form appeared before in \cite{menon1968}. To tackle the problem of finding the scaled matrix, one can perform a {\em Sinkhorn-Knopp-like algorithm} by alternatively normalizing the row and column sums of $M$ as follows: \medskip \noindent {\bf Algorithm 1} {\em (Sinkhorn-Knopp-like algorithm for nonnegative $M \in \mathbb{R}^{m\times n}$)} \noindent Initialize: $D_{M,\ell} = I_m$ and $D_{M,r} = I_n$ \begin{itemize} \item[\rm(1)] Multiply each row $i$ of $M$ and of $D_{M,\ell}$ by $\dfrac{r_i}{\sum_{j} m_{ij}}$ to obtain an updated matrix $M$ with row sums $r$ and an updated matrix $D_{M,\ell}$. \item[\rm(2)] Multiply each column $j$ of the updated $M$ and of $D_{M,r}$ by $\dfrac{c_j}{\sum_{i} m_{ij}}$ to obtain an updated matrix $M$ with column sums $c$ and an updated matrix $D_{M,r}$. \item[\rm(3)] If the row sums of the matrix $M$ obtained in step $\rm(2)$ are far from $r$, repeat steps $\rm(1)$ and $\rm(2)$ with such $M$ until an adequate stopping criterion is satisfied. \end{itemize} \medskip \noindent We give a MATLAB code of this algorithm in Appendix $A$. This algorithm appeared as early as in \cite{yule2012} and \cite{kruithof37} and, according to \cite[Section 3.1]{Idel}, it has been rediscovered several times in the literature and has received different names as, for instance, the Kruithof's projection method (see \cite{Krupp}) or the RAS method, among many others. In this paper, we have decided to refer to this method as the Sinkhorn-Knopp-like algorithm, because if $r=c= {\mathbf{1}}_n$ and $M$ is square, then it collapses to the famous Sinkhorn-Knopp algorithm for scaling a nonnegative matrix to a doubly stochastic matrix \cite{SiK}. If the Sinkhorn-Knopp-like algorithm converges, i.e., $M$ converges and the diagonal matrices of the iteration converge to positive bounded diagonal matrices, the limit will be the scaled matrix $D_{M,\ell} M D_{M,r}$ in Theorem \ref{thm.RS2ab}. \cblu{Another important result in this context is that there exists at most one solution for the two-sided diagonal scaling problem in \eqref{eq:RS_prob} for any prescribed vectors $r$ and $c$. This is stated in the following Theorem \ref{RS}, which is a partial result of what is proven in \cite[Theorem 4]{RoSc}.} \begin{theorem} \label{RS} Let $M\in \mathbb{R}^{m\times n}$ be a nonnegative matrix and let $r\in \mathbb{R}^{m\times 1}$ and $c\in \mathbb{R}^{n\times 1}$ be strictly positive vectors satisfying ${\mathbf{1}}_m^Tr=c^T{\mathbf{1}}_n$. Then there exists at most one two-sided scaled matrix $S= D_{M,\ell} M D_{M,r}$ with row sums $S{\mathbf{1}}_n=r$ and column sums ${\mathbf{1}}_m^TS=c^T$, where $D_{M,\ell}$ and $D_{M,r}$ are diagonal matrices with positive main diagonals. \end{theorem} \cblu{A less general version of Theorem \ref{RS} appeared in \cite{menon1968} and the general case is implicit in \cite{menon1969}. We emphasize that, although $S$ is unique when it exists, the matrices $D_{M,\ell}$ and $D_{M,r}$ are not necessarily unique. We refer the reader to \cite[Theorem 4]{RoSc} for a description of all matrices $D_{M,\ell}$ and $D_{M,r}$ that satisfy $S= D_{M,\ell} M D_{M,r}$.} A surprising and useful result is that the Sinkhorn-Knopp-like algorithm converges if and only if the scaling problem \eqref{eq:RS_prob} has solution. This was proved for general matrices and arbitrary prescribed row and column sum vectors in \cite{Krupp} and for the case of square nonnegative matrices and $r = c = 1_n$ in \cite{SiK}, i.e., for the doubly stochastic case (see also \cite[Theorem 4.1]{Idel}). Next, we state this important result. \begin{theorem}\label{conv} Under the assumptions in Theorem \ref{RS}, there exist diagonal matrices $D_{M,\ell}$ and $D_{M,r}$ with positive main diagonals such that \eqref{eq:RS_prob} is satisfied if and only if the Sinkhorn-Knopp-like algorithm converges. \end{theorem} Therefore, if a nonnegative matrix $M$ can be scaled for prescribed row and column sums, the scaled matrix is unique and is the limit of the Sinkhorn-Knopp-like algorithm, which gives a practical numerical procedure to check for scalability. Unfortunately, the Sinkhorn-Knopp-like algorithm can be very slow, in particular for sparse matrices, and other faster algorithms have been developed in the literature (see \cite[Section 7]{Idel}, \cite[Section 4.3]{CuturiPeyre} and the references therein). However, we emphasize that for the main purpose of this paper, i.e., improving the accuracy of computed eigenvalues of pencils, we have always found that the Sinkhorn-Knopp-like algorithm is fast enough and that the cost of its application is much smaller than the cost of computing the eigenvalues. The reason is that, in this case, the diagonal entries of the scalings $D_{M,\ell}$ and $D_{M,r}$ to be applied to the pencil must be integer powers of $2$ which allows to use a very relaxed stopping criterion in the Sinkhorn-Knopp-like algorithm. We will discuss this issue in depth in Section \ref{sec:numerics}. One can find necessary and sufficient non-algorithmic conditions for the scaled matrix to exist in \cite[Theorem 2]{RoSc}, \cite[Theorem 2.1]{Brualdi66} and \cite[Theorem 4.1]{Idel}. However, these conditions depend on nontrivial properties that must be satisfied by the vectors $r$ and $c$, as those we state in Lemma \ref{lem_RS}. In general, necessary and sufficient conditions depending only on the zero pattern of $M$ are not known. A remarkable exception to this comment is the doubly stochastic scaling problem $r = c = {\mathbf{1}}_n$ for square matrices, where such a condition is provided by the total support of the matrix (see Section \ref{sec:regular}). In the next section, we will present new simple sufficient conditions depending only on the zero pattern for diagonal scalings to exist with prescribed common vector for the row and column sums in the case of balancing square pencils and matrices. There are infinitely many examples of nonnegative matrices that cannot be scaled for prescribed $r$ and $c$. \cblu{The following example illustrates this fact.} \begin{example} \label{ex:nonsquare} For instance, one can easily check that the matrix $$M:=\begin{bmatrix} 1 & 1 & 1 \\ 0 & 0 & 1 \end{bmatrix}$$ can not be scaled with prescribed vectors $r:=[3, 3]^{T}$, for the row sums, and $c:=[2, 2, 2]^{T}$, for the column sums. \end{example} \section{Scaling square pencils and related problems} \label{sec:regular} Let us first look at the case of square pencils. In \cite[page 259]{LemVD}, positive diagonal matrices $D_\ell$ and $D_r$ are chosen to equilibrate the row and column norms of a $n\times n$ regular pencil $\lambda B-A$, by imposing \begin{equation} \label{balanced} \|\text{col}_j (\widetilde{A})\|_2^2 + \|\text{col}_j (\widetilde{B})\|_2^2 = \|\text{row}_i (\widetilde{A})\|_2^2 + \|\text{row}_i (\widetilde{B})\|_2^2 = \gamma^2 \text{, for }i,j=1,\ldots,n, \end{equation} for some constant $\gamma$ resulting from the balancing, where $\widetilde{A}:=D_\ell A D_r$ and $\widetilde{B}:=D_\ell B D_r$, and $\|\cdot\|_2$ denotes the standard Euclidean norm of a vector \cite{GoVL}. A pencil satisfying these conditions was called {\em balanced} and an algorithm was presented in \cite{LemVD} to compute a scaling to balance a regular pencil $\lambda B-A$. It was shown that this amounts to solving the following norm minimization problem \begin{equation} \label{inf1} \inf_{\det{D_\ell}.\det{D_r}=1} \|D_\ell(\lambda B-A)D_r\|_F^2, \end{equation} using the so-called Frobenius norm of a pencil: $$ \|\lambda B-A\|_F^2 := \|B\|_F^2+ \|A\|_F^2, $$ where $ \|A\|_F$ and $\|B\|_F$ are the matrix Frobenius norms of $A$ and $B$ \cite{GoVL}. Moreover, the following result was proven in \cite{LemVD}. \begin{theorem} The minimization problem \begin{equation} \label{infT} \inf_{\det{T_\ell}.\det{T_r}=1} \|T_\ell(\lambda B-A)T_r\|_F^2, \end{equation} where $T_\ell$ and $T_r$ are arbitrary nonsingular matrices, has a so-called {\em standardized normal pencil} $\lambda \hat B- \hat A$ as solution, satisfying $$ U_\ell(\lambda \hat B- \hat A)U_r = \lambda \Lambda_B-\Lambda_A, \quad U_\ell^* U_\ell= U_r^* U_r=I_n, \quad |\Lambda_B|^2+ |\Lambda_A|^2 = \gamma^2 I_n, $$ where $\Lambda_B$ and $\Lambda_A$ are diagonal. If the eigenvalues of the regular pencil $\lambda B-A$ are distinct, then $T_\ell$ and $T_r$ have a bounded solution and the infimum is a minimum; otherwise they may be unbounded. \end{theorem} As shown in \cite{LemVD}, the standardized normal pencils happen to have eigenvalues with condition number bounded by $\sqrt{2}$. This explains why performing the same minimization over the diagonal scalings is likely to improve the sensitivity of the eigenvalue computation. Moreover, if the transformation matrices are bounded then the eigenstructure of the regular pencil is preserved. \medskip But the positive diagonal scalings that achieve the balancing in \cite{LemVD} are not unique, and they may not exist or may be unbounded. In order to analyze this further we relate this problem to that of scaling a real nonnegative square matrix by two-sided scalings to a doubly stochastic matrix, or in other words, to make the row sums and column sums equal to 1. \cblu{As mentioned before, an algorithm to solve this problem has been developed and analyzed by Sinkhorn and Knopp \cite{SiK} and reduces to Algorithm 1 with $r = c = {\mathbf{1}}_n$. Further analysis can be found in \cite{Knight}}. The link between both problems is the following. Let us define the nonnegative matrices \begin{equation} \label{nonneg} M := |A|^{\circ 2}+|B|^{\circ 2}, \quad \mathrm{and} \quad \widetilde{M} := |\widetilde{A}|^{\circ 2}+|\widetilde{B}|^{\circ 2} \end{equation} where $|X|$ indicates the element-wise absolute value of the matrix $X$, where $X^{\circ 2}$ indicates the elementwise square of the matrix $X$, and where $D_\ell$ and $D_r$ satisfy the balancing equations \eqref{balanced}. Then the scaled matrix $ \widetilde{M}= D_\ell^2 M D_r^2 $ satisfies $$ \widetilde{M} \mathbf{1}_n= D_\ell^2 (|A|^{\circ 2}+|B|^{\circ 2}) D_r^2 \mathbf{1}_n= \gamma^2\mathbf{1}_n , \quad \mathbf{1}_n^T\widetilde{M}= \mathbf{1}_n^T D_\ell^2 (|A|^{\circ 2}+|B|^{\circ 2}) D_r^2 = \gamma^2\mathbf{1}_n^T $$ which implies that $\widetilde{M}/\gamma^2$ is doubly stochastic and that the two-sided scaling for the nonnegative matrix $M$ satisfies $$ \widetilde M /\gamma^2= D_{M,\ell} M D_{M,r}, \quad \mathrm{where} \quad D_{M,\ell}:=D_\ell^{2}/\gamma, \; D_{M,r}:=D_r^2/\gamma.$$ The only difference is that for balancing, we impose a scalar constraint $\det{D_\ell} \cdot \det{D_r}=1$, which is why the resulting row and column norms are equal to $\gamma^2$ rather than 1. In fact, the algorithm proposed in \cite{LemVD} was to alternately normalizing the rows and columns of $M$ to 1 (rather than $\gamma$), and that is precisely the algorithm of Sinkhorn-Knopp. This connection was not established in \cite{LemVD}. It follows from this that the unicity or boundedness of the scalings are equivalent for the two problems. We recall in Theorem \ref{SK} the results given for two-sided scaling in \cite{SiK} for square nonnegative matrices $M\in \mathbb{R}^{n\times n}$ in order \cblu{for} the corresponding matrix to become doubly stochastic. We notice that the doubly stochastic scaling problem of Theorem \ref{SK} is a special case of the scaling problem in Theorem \ref{RS}, just by considering square matrices and $r=c={\mathbf{1}}_n$. Before stating Theorem \ref{SK}, we introduce the notions of total support and full indecomposability, that will be used. \begin{definition} The sequence $m_{1,\sigma(1)},m_{2,\sigma(2)},\cdots,m_{n,\sigma(n)}$, where $\sigma$ is a permutation of $\{1,2,\cdots,n\}$, is called a diagonal of a $n\times n$ square matrix $M$. A nonnegative matrix $M\in\mathbb{R}^{n\times n}$ is said to have {\em total support} if every positive element of $M$ lies on a positive diagonal. \end{definition} \begin{definition} A nonnegative matrix $M\in\mathbb{R}^{n \times n}$ is said to be {\em fully indecomposable} if there do not exist permutation matrices $P_\ell$ and $P_r$ such that $P_\ell M P_r$ can be partitioned as $$ P_\ell M P_r=\left[\begin{array}{cc} M_{11} & M_{12} \\ 0 & M_{22} \end{array} \right], $$ where $M_{11}$ and $M_{22}$ are square matrices. \end{definition} \begin{remark} \rm It was proved in \cite{Brualdi2} that a fully indecomposable matrix has total support. \end{remark} \begin{theorem}(Sinkhorn-Knopp) \label{SK} If $M\in \mathbb{R}^{n\times n}$ is a nonnegative matrix then a necessary and sufficient condition that there exists a doubly stochastic matrix $S$ of the form $S= D_{M,\ell} M D_{M,r}$, where $D_{M,\ell}$ and $D_{M,r}$ are diagonal matrices with positive main diagonals, is that $M$ has total support. If $S$ exists, then it is unique. $D_{M,\ell}$ and $D_{M,r}$ are also unique up to a nonnegative scalar multiple if and only if $M$ is fully indecomposable. \end{theorem} The doubly stochastic matrix $S$ can be obtained as a limit of a sequence of matrices generated by alternately normalizing the row and column sums of $M$\cblu{, i.e., by applying Algorithm 1 with $r = c = {\mathbf{1}}_n$, which is the Sinkhorn-Knopp algorithm. As a consequence of Theorems \ref{conv} and \ref{SK}, a necessary and sufficient condition that the Sinkhorn-Knopp algorithm applied to $M$} will converge to a doubly stochastic limit of the form $D_{M,\ell} M D_{M,r}$ is that $M$ has total support \cite{Knight,SiK}. We recall in the following Theorem \ref{th:symmetric} the particular case of having a symmetric and fully indecomposable matrix $M$. This case will be important in the new regularized scaling method developed in Section \ref{sec:regularized}. \begin{theorem}\cite[Lemma 4.1]{Knight}\label{th:symmetric} If $M\in \mathbb{R}^{n\times n}$ is a symmetric nonnegative and fully indecomposable matrix then there exists a unique diagonal matrix $D$ with positive main diagonal such that $DMD $ is doubly stochastic. \end{theorem} \begin{remark}\label{bounded} When $M$ is fully indecomposable, the solution set for the diagonal scalings is $\mathcal{S}:=\{(D_{M,\ell}/c, cD_{M,r}) : c > 0\}$, for a given solution $(D_{M,\ell}, D_{M,r})$. To guarantee unicity for a solution in $\mathcal{S}$, one can consider a unique ``normalized'' scaling pair $(D_{M,\ell}, D_{M,r})$. For instance, by imposing that the solution satisfies $\det D_{M,\ell} = \det D_{M,r}$ or $\displaystyle\max_{i=1,\ldots,n} \{d_{i}^{\ell}\} = \displaystyle\max_{i=1,\ldots,n}\{d_{i}^{r}\} $, where $d_{i}^{\ell}$ and $d_{i}^{r}$ are the diagonal entries of $D_{M,\ell}$ and $D_{M,r}$, respectively. Then the pair $(D_{M,\ell}, D_{M,r})$ is unique in $\mathcal{S}$. Moreover, when $M$ is symmetric, then these normalizations imply that $D_{M,\ell}=D_{M,r}$. In summary, one can always perform a normalization in order to obtain unicity for the diagonal scalings. \end{remark} In the following examples, we illustrate what is happening when the conditions mentioned in Theorem \ref{SK} do not hold. \begin{example}\label{examples} Let us consider the regular pencil $$ \lambda B_1 - A_1 :=\left[\begin{array}{ccc} 1 & \lambda & 0 \\ \lambda & 0 & 0 \\ 0 & 0 & 1 \end{array}\right],\quad \text{and let}\quad M_1 :=\left[\begin{array}{ccc} 1 & 1 & 0 \\ 1 & 0 & 0 \\ 0 & 0 & 1 \end{array}\right] $$ be the corresponding matrix $M:=M_1$ in \eqref{nonneg}. $M_1$ has no total support since the (1,1) entry is not on a positive diagonal. The Sinkhorn-Knopp algorithm does not converge for this example. In fact, any candidate pair of scalings $D_{M,\ell}=\diag (\ell_1,\ell_2,\ell_3)$, and $D_{M,r}=\diag (r_1,r_2,r_3),$ has to satisfy $\ell_1 r_2=\ell_2 r_1=\ell_3 r_3=1$ and $\ell_1 r_1=0$ which does not have a bounded solution. Now, let us consider the regular pencil $$ \lambda B_2 - A_2 :=\left[\begin{array}{ccc} 1 & \lambda & 0 \\ \lambda & 1 & 0 \\ 0 & 0 & 1 \end{array}\right],\quad \text{ and let}\quad M_2 :=\left[\begin{array}{ccc} 1 & 1 & 0 \\ 1 & 1 & 0 \\ 0 & 0 & 1 \end{array}\right] $$ be the corresponding matrix $M:=M_2$ in \eqref{nonneg}. In this case, $M_2$ has total support and the Sinkhorn-Knopp algorithm converges. Indeed, the following positive diagonal scaling makes $M$ doubly stochastic: $$ \left[\begin{array}{ccc} \sqrt{\frac12} & 0 & 0 \\ 0 & \sqrt{\frac12} & 0 \\ 0 & 0 & 1 \end{array}\right] \left[\begin{array}{ccc} 1 & 1 & 0 \\ 1 & 1 & 0 \\ 0 & 0 & 1 \end{array}\right] \left[\begin{array}{ccc} \sqrt{\frac12} & 0 & 0 \\ 0 & \sqrt{ \frac12}& 0 \\ 0 & 0 & 1 \end{array}\right] = \left[\begin{array}{ccc} \frac12 & \frac12 & 0 \phantom{\Big|} \\ \frac12 & \frac12 & 0 \phantom{\Big|} \\ 0 & 0 & 1 \end{array}\right]. $$ However, $M_2$ is not fully indecomposable, which implies that $D_{M,\ell}$ and $D_{M,r}$ are not unique up to a scalar multiple. In this case, the Sinkhorn-Knopp algorithm may converge to different diagonal scaling matrices for different starting diagonal initial conditions. Moreover, it may converge to unbounded $D_{M,\ell}$ and $D_{M,r}$. For instance, for the following scaling $$ \left[\begin{array}{ccc} t \sqrt{\frac12} & 0 & 0 \\ 0 & t \sqrt{\frac12} & 0 \\ 0 & 0 & 1/s \end{array}\right] \left[\begin{array}{ccc} 1 & 1 & 0 \\ 1 & 1 & 0 \\ 0 & 0 & 1 \end{array}\right] \left[\begin{array}{ccc} \dfrac{1}{t}\sqrt{\frac12} & 0 & 0 \\ 0 & \dfrac{1}{t}\sqrt{\frac12}& 0 \\ 0 & 0 & s \end{array}\right] = \left[\begin{array}{ccc} \frac12 & \frac12 & 0 \phantom{\Big|} \\ \frac12 & \frac12 & 0 \phantom{\Big|} \\ 0 & 0 & 1 \end{array}\right] $$ the right diagonal matrix is unbounded as $t\to 0$ and the left one as $s\to 0$. Finally, let us consider the regular pencil $$ \lambda B_3 - A_3 :=\left[\begin{array}{ccc} 1 & \lambda & 0 \\ \lambda & 0 & \lambda \\ 0 & \lambda & 1 \end{array}\right],\quad \text{ and let}\quad M_3 :=\left[\begin{array}{ccc} 1 & 1 & 0 \\ 1 & 0 & 1 \\ 0 & 1 & 1 \end{array}\right] $$ be the corresponding matrix $M:=M_3$ in \eqref{nonneg}. In this case, $M_3$ has total support and is, in addition, fully indecomposable. Then the scaling procedure converges to bounded diagonal scaling matrices, that are essentially unique (up to a scalar multiple): $$ \left[\begin{array}{ccc} \sqrt{\frac12} & 0 & 0 \\ 0 & \sqrt{\frac12} & 0 \\ 0 & 0 & \sqrt{\frac12} \end{array}\right] \left[\begin{array}{ccc} 1 & 1 & 0 \\ 1 & 0 & 1 \\ 0 & 1 & 1 \end{array}\right] \left[\begin{array}{ccc} \sqrt{\frac12} & 0 & 0 \\ 0 & \sqrt{\frac12}& 0 \\ 0 & 0 & \sqrt{\frac12} \end{array}\right] = \left[\begin{array}{ccc} \frac12 & \frac12 & 0 \phantom{\Big|} \\ \frac12 & 0 & \frac12 \phantom{\Big|} \\ 0 & \frac12 & \frac12 \phantom{\Big|} \end{array}\right]. $$ \end{example} For the general scaling problem in Theorem \ref{RS}, with arbitrary prespecified vectors for the row and column sums, sufficient conditions on $M$ for the scaling to exist \cblu{as simple as those in Theorem \ref{SK}, which are based only on the zero pattern of $M$,} are not known in the literature, \cblu{to the best of our knowledge}, not even in the case of a square matrix $M$. \cblu{This motivated us to develop the results in the next subsection.} \subsection{\cblu{Diagonal scalings of square nonnegative matrices with prescribed common vector for the row and column sums}} We now derive \cblu{simple} sufficient conditions \cblu{on the zero pattern} for the existence of a diagonal scaling of a square matrix $M$ by considering not only the vector ${\mathbf{1}}_n$ but any prescribed common vector \cblu{$v$} for the row and column sums. For that, we use the following Lemma \ref{lem_RS}, which is a partial result of \cite[Theorem 2]{RoSc}. In what follows, the support of a matrix $A\in \mathbb{R}^{m\times n}$, denoted by $\text{supp}(A)$, is defined as the set $\{(i, j)\,|\,a_{ij}\neq 0, i=1,\cdots,m, \text{ and } j=1,\cdots,n\}$. \begin{lemma}\label{lem_RS} Let $M\in \mathbb{R}^{m\times n}$ be a nonnegative matrix and let $r\in \mathbb{R}^{m\times 1}$ and $c\in \mathbb{R}^{n\times 1}$ be strictly positive vectors such that ${\mathbf{1}}_m^Tr=c^T{\mathbf{1}}_n$. Then there exists a scaled matrix $S= D_{M,\ell} M D_{M,r}$ with row sums $S{\mathbf{1}}_n=r$ and column sums ${\mathbf{1}}_m^TS=c^T$, where $D_{M,\ell}$ and $D_{M,r}$ are diagonal matrices with positive main diagonals, if and only if there exist no pair of vectors $(u, v)\in \mathbb{R}^{m} \times \mathbb{R}^{n}$ for which \begin{itemize} \item[\rm(a)] $u_i + v_j \leq 0$ for each pair $(i,j)\in\text{supp}(M),$ \item[\rm(b)] $ r^T u = c^T v = 0,$ and \item[\rm(c)] $u_{i_0} + v_{j_0} < 0$ for some pair $(i_0,j_0)\in\text{supp}(M)$. \end{itemize} \end{lemma} \begin{theorem}\label{th_squareRS} Let $M\in \mathbb{R}^{n\times n}$ be a nonnegative matrix with $(i,i)\in\text{supp}(M)$ for all $i=1,\cdots,n$ and such that $\text{supp}(M)=\text{supp}(M^T) $. Let $v\in \mathbb{R}^{n\times 1}$ be a strictly positive vector. Then there exists a scaled matrix $S= D_{M,\ell} M D_{M,r}$ with row sums $S{\mathbf{1}}_n=v$ and column sums ${\mathbf{1}}_n^TS=v^T$, where $D_{M,\ell}$ and $D_{M,r}$ are diagonal matrices with positive main diagonals. Moreover, $S$ is unique and is the limit of the Sinkhorn-Knopp-like algorithm. If, in addition, $M$ is fully indecomposable then $D_{M,\ell}$ and $D_{M,r}$ are also unique up to a nonnegative scalar multiple \cblu{and, if $M=M^T$, then there exists a unique diagonal matrix $D$ with positive diagonal entries such that $S = DMD$}. \end{theorem} \begin{proof} Consider a $n\times n$ nonnegative matrix $M$ such that $\text{supp}(M)=\text{supp}(M^T) $ and $(i,i)\in\text{supp}(M)$ for all $i=1,\cdots,n$. By contradiction, let us assume that there exists no scaled matrix $S$ with row sums $S{\mathbf{1}}_n=v$ and column sums ${\mathbf{1}}_n^TS=v^T$. Then, by Lemma \ref{lem_RS}, there exists a pair of vectors $(x, y)\in \mathbb{R}^{n} \times \mathbb{R}^{n}$ for which \begin{itemize} \item[\rm(a)] $x_i + y_j \leq 0 $ for each pair $ (i,j)\in\text{supp}(M),$ \item[\rm(b)] $ v^T x = v^T y = 0,$ and \item[\rm(c)] $ x_{i_0} + y_{j_0} < 0 $ for some pair $ (i_0,j_0)\in\text{supp}(M).$ \end{itemize} Condition $\rm(b)$ implies that \begin{equation}\label{eq:sum} v_1(x_1+y_1)+\cdots+v_n(x_n+y_n)=0. \end{equation} In addition, since $(i,i)\in\text{supp}(M)$ for all $i=1,\dots,n$, condition $\rm(a)$ implies that $x_i+y_i\leq 0$ for all $i=1,\dots ,n$. It then follows from \eqref{eq:sum} that $x_i+y_i = 0$ for all $i=1,\dots ,n$ since $v_i>0$. Moreover, by condition $\rm(c)$, there exists a pair $ (i_0,j_0)\in\text{supp}(M)$ such that $ x_{i_0} + y_{j_0} < 0 $. Taking into account that $x_i+y_i=0$ for all $i=1,\dots , n$ we have that \begin{equation}\label{eq:sum2} (x_{i_0}+y_{i_0})+(x_{j_0}+y_{j_0})=0. \end{equation} By equation \eqref{eq:sum2} and the fact that $ x_{i_0} + y_{j_0} < 0 $, we obtain that $ x_{j_0} + y_{i_0} > 0 $. Therefore, by $\rm(a)$, $(j_0,i_0)\not\in\text{supp}(M)$, which is a contradiction since $ (i_0,j_0)\in\text{supp}(M)$ and $\text{supp}(M)=\text{supp}(M^T) $. The uniqueness of $S$ is a consequence of Theorem \ref{RS}, and it is the limit of the Sinkhorn-Knopp-like algorithm by Theorem \ref{conv}. If $M$ is fully indecomposable its bipartite graph is connected \cite[Theorem 1.3.7]{Brualdi} and, thus, it is chainable \cite[Theorem 1.2]{Chainable} (see \cite{Chainable} or \cite{RoSc} for the definition of ``chainable''). Then, by \cite[Theorem 4]{RoSc}, $D_{M,\ell}$ and $D_{M,r}$ are also unique up to a nonnegative scalar multiple. \cblu{Finally, if, in this situation, $M=M^T$, then transposing both sides of $D_{M,\ell} M D_{M,r} {\mathbf{1}}_n = v$ and of ${\mathbf{1}}_n^T D_{M,\ell} M D_{M,r} = v^T$ implies ${\mathbf{1}}_n^T D_{M,r} M D_{M,\ell} = v^T$ and $D_{M,r} M D_{M,\ell} {\mathbf{1}}_n = v$, which combined with the uniqueness of $D_{M,\ell}$ and $D_{M,r}$ up to an scalar multiple, implies that $D_{M,r} = \alpha D_{M,\ell}$ for some $\alpha >0$, and $D = \sqrt{\alpha} D_{M,\ell}$ is the unique nonnegative diagonal matrix satisfying $S = DMD$.} \end{proof} If $M$ satisfies the conditions in Theorem \ref{th_squareRS}, the scaled matrix $S$ can be computed by using the Sinkhorn-Knopp-like algorithm in \cblu{Appendix $A$} with prescribed common vector $v$ for the row and column sums, i.e., with $r=c=v$. In Section \ref{sec:regularized}, we will present new cost functions for our minimization problem \eqref{inf1} to make sure that it always has a unique and bounded solution. This new approach will be based on the results presented in this section combined with regularization techniques. In addition, this new approach will be applied to arbitrary pencils (square or nonsquare). First, we study in \cblu{Section \ref{sec:nonsquare} the unregularized} nonsquare case. \section{Scaling nonsquare pencils and related problems} \label{sec:nonsquare} In the square case, we scaled the pencil so that its row norms and column norms were equal as in \eqref{balanced}. However, this is no longer possible for $m\times n$ rectangular pencils since the numbers of rows and columns are different. But instead, one can try to balance the pencil $\lambda B-A$ by achieving the following equalities \begin{equation}\label{columnrow_norms} \begin{split} & \|\text{col}_j (\widetilde{A})\|_2^2 + \|\text{col}_j (\widetilde{B})\|_2^2 = \gamma_\ell^2 \text{, for }j=1,\ldots, n, \text{ and} \\ & \|\text{row}_i (\widetilde{A})\|_2^2 + \|\text{row}_i (\widetilde{B})\|_2^2 = \gamma_r^2 \text{, for }i=1,\ldots, m, \end{split} \end{equation} where $\widetilde{A}:=D_\ell A D_r$ and $\widetilde{B}:=D_\ell B D_r$ and $\|\lambda \widetilde{B}-\widetilde{A}\|_F^2=n\gamma_\ell^2=m\gamma_r^2$. For the nonsquare case, we also define the nonnegative matrices \begin{equation} \label{nonneg_nonsquare} M := |A|^{\circ 2}+|B|^{\circ 2}, \quad \mathrm{and} \quad \widetilde{M} := |\widetilde{A}|^{\circ 2}+|\widetilde{B}|^{\circ 2}. \end{equation}The scaling problem discussed in this section is a special case of the general scaling problem in Theorem \ref{RS}, where we choose $r=\gamma^2_r {\mathbf{1}}_m$ and $c=\gamma^2_\ell {\mathbf{1}}_n$. We now show that there is an optimization problem whose first order optimality conditions corresponds to the equalities in \eqref{columnrow_norms}. \begin{theorem} \label{th:balanceAB} The following minimization problem over the set of positive diagonal matrices $D_\ell=\diag (d_{\ell_1}, \ldots ,d_{\ell_m})$ and $D_r=\diag (d_{r_1}, \ldots ,d_{r_n})$~: $$ \inf_{\det D_\ell^2=c_\ell,\det D_r^2 =c_r} (\| D_\ell A D_r \|_F^2 +\| D_\ell B D_r \|_F^2) $$ has the balancing equations \eqref{columnrow_norms} as first order optimality conditions. \end{theorem} \begin{proof} If one makes the change of variables for the elements of $D_\ell$ and $D_r$ as follows $d^2_{\ell_i}=\exp(u_i)$, $d^2_{r_j}=\exp(v_j)$, and introduce the notation $m_{ij}:=|a_{ij}|^2+|b_{ij}|^2$, then the above minimization is equivalent to a convex minimization problem with linear constraints~: \begin{equation}\label{constrained} \inf \sum_{i=1}^m \sum_{j=1}^n m_{ij} \exp(u_i+v_j), \quad \mathrm{subject \;\; to} \quad \sum_{i=1}^m u_i = \ln c_\ell , \quad \sum_{j=1}^n v_j= \ln c_r. \end{equation} The corresponding unconstrained problem with Lagrange multipliers $\Gamma_\ell$ and $\Gamma_r$, is $$ \inf \sum_{i=1}^m \sum_{j=1}^n m_{ij} \exp(u_i+v_j) + \Gamma_\ell(\ln c_\ell- \sum_{i=1}^m u_i) + \Gamma_r(\ln c_r - \sum_{j=1}^n v_j ). $$ The first order conditions of optimality are the equality constraints of \eqref{constrained} and the equations \begin{equation}\label{eqconst} \sum_{j=1}^n d^2_{\ell_i}m_{ij}d^2_{r_j} = \Gamma_\ell, \quad \sum_{i=1}^m d^2_{\ell_i}m_{ij}d^2_{r_j} = \Gamma_r, \end{equation} which express exactly that the row norms of $\widetilde M:= D_\ell^2MD_r^2$ are equal to each other and that its column norms are equal to each other. Since the Lagrange multipliers $\Gamma_\ell$ and $\Gamma_r$ are clearly nonnegative, we can can write them as $\gamma^2_\ell:=\Gamma_\ell$ and $\gamma^2_r:=\Gamma_r$, which completes the proof. \end{proof} It is important to emphasize that unfortunately the optimization problem in Theorem \ref{th:balanceAB} does not always have a solution. This happens, for instance, if the corresponding matrix $M := |A|^{\circ 2}+|B|^{\circ 2}$ is the matrix appearing in Example \ref{ex:nonsquare}. If there exists solution for the optimization problem in Theorem \ref{th:balanceAB}, it can be obtained by a sequence of alternating scalings $D_\ell^2$ and $D_r^2$ that make the rows of $D_\ell^2(MD_r^2)$ have equal sum $\gamma_r^2$, and then the columns of $(D_\ell^2M)D_r^2$ have equal sum $\gamma_\ell^2$, while maintaining the constraints $\det D_\ell^2=c_\ell$, $\det D_r^2 =c_r$ \cblu{in the accumulated diagonal transformations, which determine the values of $\gamma_r^2$ and $\gamma_\ell^2$}. The cyclic alternation of row and column scalings, then amounts to coordinate descent applied to the minimization. This algorithm thus continues to decrease the cost function as long as the equalities \eqref{eqconst} are not met. \cblu{This is very similar to the Sinkhorn-Knopp-like Algorithm 1 applied to $M$ with $r = \gamma_r^2 {\mathbf{1}}_m$ and $c = \gamma_\ell^2 {\mathbf{1}}_n$. Since the exact values of $\gamma_r^2$ and $\gamma_\ell^2$ are of no interest, in practice one can simply apply Algorithm 1 to $M$ with $r = n {\mathbf{1}}_m$ and $c = m {\mathbf{1}}_n$. Recall that, according to Theorem \ref{conv}, this algorithm converges if and only if the corresponding scaling problem has solution.} \begin{example} \label{Ex1} Let us consider the pencil of a $5\times 6$ Kronecker block $$ \lambda B - A :=\left[\begin{array}{cccccc} \lambda & -1 \\ & \lambda & -1 \\ & & \lambda & -1 \\ & & & \lambda & -1 \\ & & & & \lambda & -1 \end{array}\right] $$ then the scaled matrix $\widetilde M$ and the corresponding diagonal scaling matrices $D_\ell^2$ and $D_r^2$ look like \begin{equation} \label{eq.perfectM5x6} \widetilde M :=\left[\begin{array}{cccccc} 5 & 1 \\ & 4 & 2 \\ & & 3 & 3 \\ & & & 2 & 4 \\ & & & & 1 & 5 \end{array}\right] , \quad \begin{array}{cc} D^2_\ell =\diag (1, 4, 6, 4, 1), & \gamma^2_\ell=5, \\ \\ D_r^2=\diag (5, 1, 0.5, 0.5, 1, 5), & \gamma^2_r=6.\end{array} \end{equation} \end{example} \section{The regularized scaling method for pencils}\label{sec:regularized} The facts that for a nonsquare pencil the doubly stochastic scaling can not be applied anymore, that even for square pencils the corresponding matrix $M$ may not have total support and that the optimization problem in Theorem 4.1 does not always have solution can be by-passed by introducing a regularization term which will ensure an essentially unique bounded solution for $D_\ell$ and $D_r$. The cost of introducing such a term is that we will obtain a solution of an approximate problem. Nevertheless, with the new approach we can always assure that we will find such a solution. Given two matrices $A,$ $B$ of size $m\times n,$ we consider the following constrained minimization problem over the set of \cblu{positive} diagonal matrices $D_\ell=\diag (d_{\ell_1}, \ldots ,d_{\ell_m})$ and $D_r=\diag (d_{r_1}, \ldots ,d_{r_n})$~: \begin{equation} \label{form1} \inf_{\det D_\ell^2\det D_r^2=c} 2(\| D_\ell A D_r \|_F^2 +\| D_\ell B D_r \|_F^2) + \alpha^2\left(\frac{1}{m^2}\|D_\ell \|_F^4+\frac{1}{n^2}\|D_r\|_F^4 \right), \end{equation} for some real number $c>0$ and a regularization parameter $\alpha$. If we denote again the matrix $M:=|A|^{\circ 2}+|B|^{\circ 2},$ then we can rewrite this as follows: \begin{equation} \label{form2} \inf_{\det D_\ell^2\det D_r^2 =c} \mathbf{1}_{m+n}^T \left[\begin{array}{cc} \frac{\alpha^2}{m^2}D_\ell^2 \mathbf{1}_m \mathbf{1}_m^T D_\ell^2 & D_\ell^2 M D_r^2 \\ D_r^2 M^T D_\ell^2 & \frac{\alpha^2}{n^2} D_r^2 \mathbf{1}_n \mathbf{1}_n^T D_r^2 \end{array}\right] \mathbf{1}_{m+n}, \end{equation} which suggests that there may be a link to doubly stochastic scaling. Indeed, let us consider the two-sided scaling problem $\widetilde M_\alpha := D_{\ell,r} M_\alpha D_{\ell,r}$, where \begin{equation*} \label{total} D_{\ell,r}:= \left[\begin{array}{cc} D_\ell & 0 \\ 0& D_r \end{array}\right] , \end{equation*} subject to $\det D_\ell^2\det D_r^2 = \det D^2_{\ell,r} = c,$ and \begin{equation}\label{eq:Malpha} M_\alpha^{\circ 2}= \left[\begin{array}{cc} \frac{\alpha^2}{m^2} \mathbf{1}_m \mathbf{1}_m^T & M \\ M^T & \frac{\alpha^2}{n^2} \mathbf{1}_n \mathbf{1}_n^T \end{array}\right]. \end{equation} Notice that both diagonal blocks in $M_\alpha$ have Frobenius norm $\alpha$. We then prove in Theorem \ref{th_scaling} that the optimization problem \eqref{form1} can be solved by the Sinkhorn--Knopp algorithm in a unique way. We will need the following auxiliary Lemma \ref{fullyindecomp} in our proof. \begin{lemma}\label{fullyindecomp} Let $M_\alpha^{\circ 2}$ be the nonnegative matrix in \eqref{eq:Malpha} with $\alpha\neq0$. Then $M_\alpha^{\circ 2}$ has total support. Moreover, if $M \neq 0$ then $M_{\alpha}^{\circ 2}$ is fully indecomposable. \end{lemma} \begin{proof} See \cblu{Appendix B.} \end{proof} \begin{theorem}\label{th_scaling} Let $A$ and $B$ be $m\times n$ complex matrices and $\alpha,c > 0$ be real numbers. Let us consider the constrained minimization problem \eqref{form1} over the set $\{(D_{\ell},D_{r}): D_\ell:=\diag (\delta_{\ell_1},\ldots,\delta_{\ell_m}), D_r:=\diag (\delta_{r_1},\ldots,\delta_{r_n}), \delta_{\ell_i}>0, \delta_{r_j}>0\}.$ Then the following statements hold: \begin{itemize} \item[a)] The optimization problem \eqref{form1} is equivalent to the optimization problem \eqref{form2}. \item[b)] The optimization problem \eqref{form1} is equivalent to the optimization problem \begin{equation*} \inf_{\det D_\ell^2\det D_r^2 =c} \left\| \left[\begin{array}{cc} D_\ell & 0 \\ 0& D_r \end{array}\right] M_\alpha \left[\begin{array}{cc} D_\ell & 0 \\ 0& D_r \end{array}\right]\right\|_F^2 , \end{equation*} where $M_\alpha^{\circ 2}$ is given in \eqref{eq:Malpha}. \item[c)] There exists a unique solution $(\widetilde{D}_{\ell},\widetilde{D}_{r})$ of \eqref{form1}. Moreover, $(\widetilde{D}_{\ell},\widetilde{D}_{r})$ is bounded and makes the matrix $$\left[\begin{array}{cc} \widetilde{D}_\ell^2 & 0 \\ 0& \widetilde{ D}_r^2 \end{array}\right] M_\alpha^{\circ 2} \left[\begin{array}{cc} \widetilde{D}_\ell^2 & 0 \\ 0& \widetilde{D}_r^2 \end{array}\right]$$ a scalar multiple of a doubly stochastic matrix. Therefore, $(\widetilde{D}_{\ell},\widetilde{D}_{r})$ can be computed, \cblu{up to a scalar multiple}, by applying the algorithm in Appendix A to $M_\alpha^{\circ 2}$ \cblu{with $r=c={\mathbf{1}}_{m+n}$}. \end{itemize} \end{theorem} \begin{proof} We have already seen statements $a)$ and $b)$ in this section because the optimization problem in $b)$ is just \eqref{form2}. Then we only need to prove $c).$ We make the change of variables $d^2_{\ell_i}=\exp(u_i)$ and $d^2_{r_j}=\exp(v_j)$ for the elements of $D_\ell$ and $D_r,$ respectively. Then the optimization problem \eqref{form1} is equivalent to the optimization problem: \begin{equation}\label{constrained2} \begin{split} &\inf \; 2\sum_{i=1}^m \sum_{j=1}^n m_{ij} \exp(u_i+v_j)+\alpha^2\left(\frac{1}{m^2}\left(\sum_{i=1}^m \exp(u_i) \right)^2 + \frac{1}{n^2}\left(\sum_{j=1}^n \exp(v_j) \right)^2 \right),\\ & \mathrm{subject \;\; to} \quad \sum_{i=1}^m u_i + \sum_{j=1}^n v_j = \ln c. \end{split} \end{equation} The corresponding unconstrained problem with Lagrange multiplier $\Gamma$ is: \begin{equation} \begin{split} \inf \; & 2\sum_{i=1}^m \sum_{j=1}^n m_{ij} \exp(u_i+v_j)+\alpha^2\left(\frac{1}{m^2}\left(\sum_{i=1}^m \exp(u_i) \right)^2 + \frac{1}{n^2}\left(\sum_{j=1}^n \exp(v_j) \right)^2 \right)\\ & + \Gamma \left(\ln c - \sum_{i=1}^m u_i - \sum_{j=1}^n v_j \right). \end{split} \end{equation} The first order conditions of optimality are the equality constraint of \eqref{constrained2} and the equations \begin{equation*} \frac{\alpha^2}{m^2}d^2_{\ell_i}\sum_{i=1}^m d^2_{\ell_i} + \sum_{j=1}^n d^2_{\ell_i}m_{ij}d^2_{r_j} = \dfrac{\Gamma}{2}, \quad \text{and} \quad \frac{\alpha^2}{n^2}d^2_{r_j}\sum_{j=1}^n d^2_{r_j} + \sum_{i=1}^m d^2_{\ell_i}m_{ij}d^2_{r_j} = \dfrac{\Gamma}{2}, \end{equation*} for $i=1,\ldots,m$ and $j=1,\ldots,n$, respectively, which express that the row sum and the column sum of $$\left[\begin{array}{cc} D_\ell^2 & 0 \\ 0& D_r^2 \end{array}\right] M_\alpha^{\circ 2} \left[\begin{array}{cc} D_\ell^2 & 0 \\ 0& D_r^2 \end{array}\right]$$ are equal to $\dfrac{\Gamma}{2}.$ By Lemma \ref{fullyindecomp}, we know that $M_\alpha^{\circ 2}$ is fully indecomposable. Then, by the Sinkhorn--Knopp theorem, there exists a unique and bounded scaling $(E_{\ell},E_{r})$ that makes the matrix $$\left[\begin{array}{cc} E_\ell^2 & 0 \\ 0& E_r^2 \end{array}\right] M_\alpha^{\circ 2} \left[\begin{array}{cc} E_\ell^2 & 0 \\ 0& E_r^2 \end{array}\right]$$ doubly stochastic. Assume that $\det E_\ell^2\det E_r^2=k.$ We define $\widetilde{D}_\ell :=\left(\frac{c}{k}\right)^{\frac{1}{2(m+n)}}E_{\ell}$ and $\widetilde{D}_r :=\left(\frac{c}{k}\right)^{\frac{1}{2(m+n)}}E_r.$ Then $\det \widetilde{D}_\ell^2\det \widetilde{D}_r^2=c$ and $(\widetilde{D}_{\ell},\widetilde{D}_{r})$ is the solution of \eqref{form1}. We can again redefine $\gamma^2:=\Gamma/2$ since this quantity is nonnegative. \end{proof} For completeness, we include the following result, which is a direct corollary of the proof of Theorem \ref{th_scaling}. \begin{theorem}\label{th_scaling_rowcolumnsum} Let $A$ and $B$ be $m\times n$ complex matrices and $\alpha,c > 0$ be real numbers. Then the constrained minimization problem \begin{equation*} \inf_{\det D_\ell^2\det D_r^2=c} 2(\| D_\ell A D_r \|_F^2 +\| D_\ell B D_r \|_F^2) + \alpha^2\left(\frac{1}{m^2}\|D_\ell \|_F^4+\frac{1}{n^2}\|D_r\|_F^4 \right), \end{equation*} over the set $\{(D_{\ell},D_{r}): D_\ell:=\diag (\delta_{\ell_1},\ldots,\delta_{\ell_m}), D_r:=\diag (\delta_{r_1},\ldots,\delta_{r_n}), \delta_{\ell_i}>0, \delta_{r_j}>0\}$ has a unique and bounded solution. Moreover, it satisfies the equations: \begin{equation*} \begin{split} & \|\text{col}_j (\widetilde{A})\|_2^2 + \|\text{col}_j (\widetilde{B})\|_2^2+ \frac{\alpha^2}{n^2}\delta_{r_j}^2\|D_{r}\|_F^2= \gamma^2 \text{, for }j=1,\ldots, n, \text{ and} \\ & \|\text{row}_i (\widetilde{A})\|_2^2 + \|\text{row}_i (\widetilde{B})\|_2^2 + \frac{\alpha^2}{m^2}\delta_{\ell_i}^2\|D_{\ell}\|_F^2= \gamma^2 \text{, for }i=1,\ldots, m, \end{split} \end{equation*} for some nonzero scalar $\gamma $, where $\widetilde{A}:=D_\ell A D_r$ and $\widetilde{B}:=D_\ell B D_r$. \end{theorem} \begin{remark} \rm By Theorem \ref{th_scaling}, we know that the row sums and the column sums of the matrix $$\left[\begin{array}{cc} D_\ell^2 & 0 \\ 0& D_r^2 \end{array}\right] M_\alpha^{\circ 2} \left[\begin{array}{cc} D_\ell^2 & 0 \\ 0& D_r^2 \end{array}\right]$$ are equal to each other, where $(D_\ell, D_r)$ is the solution in Theorem \ref{th_scaling_rowcolumnsum}. The quantity of such row and column sums is the scalar $\gamma^2 $ appearing in Theorem \ref{th_scaling_rowcolumnsum}. \end{remark} \cblu{ In Example \ref{ex-f51}, we will illustrate the effect of choosing different values for the regularization parameter $\alpha$ in \eqref{eq:Malpha} in order to make the row and column sums of $D_\ell^2MD_r^2$ as equal as possible for a square matrix $M$ (corresponding to a pencil $\lambda B - A$) which does not have total support and, thus, cannot be scaled to a multiple of a doubly stochastic matrix. For measuring the quality of the obtained approximate scaling in this and other examples considered in this paper, we introduce the following definition. \begin{definition} \label{def.quality-scaling} Let $M \in \mathbb{R}^{m \times n}$ be a real nonnegative matrix, let $r(M) \in \mathbb{R}^{m \times 1}$ and $c(M) \in \mathbb{R}^{n\times 1}$ be, respectively, the vectors of row sums and column sums of $M$, denote by $r_i(M)$ and $c_i (M)$ the $i$-th entries of $r(M)$ and $c(M)$, and assume $r_i(M) > 0$ and $c_j (M)>0$ for all $i,j$. Then, the quality-factor of the homogeneous scaling of $M$ is defined as \begin{equation} \label{eq.qs} q_S (M) := \max \left\{ \frac{\max_i r_i (M)}{\min_i r_i (M)} \, , \, \frac{\max_i c_i (M)}{\min_i c_i (M)} \right\} \, . \end{equation} \end{definition} Observe that $q_S(M) = 1$ if and only if the row sums of $M$ are all equal and the column sums of $M$ are all equal. The closer to $1$ the factor $q_S(M)$ is, the better balanced the matrix $M$ is. \begin{example} \label{ex-f51} We consider the square pencil $\lambda B_{1} - A_{1}$ in Example \ref{examples}. The associated matrix \begin{equation} \label{eq.matex51} M_1 :=\left[\begin{array}{ccc} 1 & 1 & 0 \\ 1 & 0 & 0 \\ 0 & 0 & 1 \end{array}\right] \end{equation} has no total support and, thus, the Sinkhorn-Knopp algorithm does not converge. More precisely, the algorithm in Appendix A applied to $M_1$ with $r = c = {\mathbf{1}}_3$ and {\tt tol}$= 10^{-3}$ does not converge after $1000$ steps. In contrast, the same algorithm applied to the matrix $M_\alpha^{\circ 2}$ in \eqref{eq:Malpha} with $r=c={\mathbf{1}}_6$ and {\tt tol}$= 10^{-3}$ for $\alpha = 1,0.5,0.1$ converges and produces scaled matrices $\widetilde M_\alpha = D_\ell^2MD_r^2$ which are approximately doubly stochastic up to a scalar multiple. The results are shown in Table \ref{table.ex51}, where the last column shows the 2-norm condition numbers of $D^2_\ell \approx D_r^2 $ and {\rm steps} denotes the number of steps until convergence, with each step comprising one right and one left diagonal scaling. \begin{table}[h!] \cblu{ \begin{center} \caption{Results of the regularization applied to the matrix in \eqref{eq.matex51} with {\tt tol}$= 10^{-3}$. The quality factors $q_S$ should be compared with $q_S(M_1) = 2$} \label{table.ex51} \begin{tabular}{c|c|c|c|c} $\alpha$ & steps & $q_S$ & $\diag (D^2_\ell) \approx \diag(D_r^2) $ & $\kappa (D^2_\ell) \approx \kappa (D_r^2) $ \\ \hline 1 & 11 & 1.38 & 0.485 , 1.29 , 0.864 & 2.66 \\ 0.5 & 24 & 1.19 & 0.395 , 2.05 , 0.952 & 5.19 \\ 0.1 & 124 & 1.04 & 0.187 , 5.15 , 0.970 & 27.5 \end{tabular} \end{center} } \end{table} \noindent Choosing a smaller $\alpha$ yields a better equilibration for the row and column sums as measured by the quality-factor $q_S$ (to be compared with $q_S (M_1) =2$ for the original matrix), but at the cost of a worse conditioning of the scaling matrices $D^2_\ell, D_r^2$ and of a slower convergence. The latter is to be expected since for $\alpha=0$ the scaling to a multiple of a double stochastic matrix does not exist for $M_1$. Finally, we show the results obtained when the algorithm in Appendix A is applied directly to $M_1$ with $r = c = {\mathbf{1}}_3$, i.e., without any regularization, but with the very relaxed stopping criterion {\tt tol}$= 1$. In this case the algorithm converges in only $3$ steps and the results are shown in Table \ref{table.ex51-bis}, where $\alpha = 0$ indicates that the problem has not been regularized (though the matrix $M_\alpha^{\circ 2}$ is not used at all). We will use this convention in other numerical examples and tests. \begin{table}[h!] \cblu{ \begin{center} \caption{Results of the unregularized Sinkhorn-Knopp algorithm applied to the matrix in \eqref{eq.matex51} with {\tt tol}$= 1$. The quality factor $q_S$ should be compared with $q_S(M_1) = 2$} \label{table.ex51-bis} \begin{tabular}{c|c|c|c|c|c|c} $\alpha$ & steps & $q_S$ & $\diag (D^2_\ell)$ & $\diag(D_r^2)$ & $\kappa (D^2_\ell)$ & $\kappa (D_r^2) $ \\ \hline 0 & 3 & 1.33 & 0.350, 2.45 , 0.765 & 0.408, 2.45, 1.31 & 7 & 6 \end{tabular} \end{center} } \end{table} The motivation for computing this rough {\tt tol}$= 1$ approximate solution will be clear in Section \ref{sec:numerics} and is related to the fact, previously commented, that for the purpose of improving the accuracy of the eigenvalues of $\lambda B -A$ computed in floating point arithmetic it is essential that the entries of the diagonal scaling matrices $D_\ell$ and $D_r$ are integer powers of $2$. This implies that it makes no sense to compute very precise scaling matrices $D_\ell$ and $D_r$, since their entries will be later rounded to their nearest integer powers of $2$ and, thus, a relaxed stopping criterion can be used. We remark here three facts that will be further discussed in Section \ref{sec:numerics}: {\tt tol}$= 1$ very often has a regularization effect, speeds up considerably the convergence and yields a reasonably ``well balanced'' matrix. \end{example} \begin{remark} \label{rem.regular} The choice of the regularization parameter $\alpha$ has to be guided by the equilibrium one wants to achieve between the ``quality'' of the balancing, the boundedness/conditioning of the diagonal scaling matrices and the speed of convergence. This depends heavily on the applied problem the user wants to solve. For the problem of improving the accuracy of computed eigenvalues, we do not need to consider a very small value of $\alpha$ since, in practice, it is enough to get a reasonably ``well balanced'' matrix $M$, because the entries of the diagonal scaling matrices have to be later rounded to their nearest integer powers of two. Moreover, as we will see in Section \ref{sec:numerics}, the use of the relaxed stopping criterion {\tt tol}$= 1$ makes it often unnecessary the use of the regularization. This can happen even in cases where the use of the regularization is mandatory from a theoretical point of view, since there is no exact solution of the scaling problem. The use of {\tt tol}$= 1$ prevents, in any case, to obtain very ``well-balanced matrices''. Thus, for the eigenvalue problem, we recommend to start always by using the un-regularized method and if it does not converge in a small number of steps (say $n/10$ for large $n$) to change to the regularized method with a value of $\alpha \lesssim 0.5 \max_{ij} \sqrt{M_{ij}}$. In contrast, in other type of problems where it is important to get always a very ``well-balanced matrix'' and a relaxed stopping criterion is not adequate or neccessary, a recommendable option might be to always use the regularization with a small value of $\alpha$, especially when $M$ is sparse, since it guarantees the existence of a solution. This will increase the complexity of the Sinkhorn-Knopp algorithm each step by a factor 4 since the matrix sizes are doubled. In difficult cases, this might be very slow and, thus, the regularized problem and the Sinkhorn-Knopp algorithm should be combined with faster algorithms (see \cite{Idel,CuturiPeyre} for the state-of-the art). \end{remark} } \begin{remark} One could also have considered for the regularization the cost function $$ \inf_{\det D_\ell^2\det D_r^2=c} 2(\| D_\ell A D_r \|_F^2 +\| D_\ell B D_r \|_F^2) + \alpha^2\left(\|D_\ell^2 \|_F^2+\|D_r^2\|_F^2 \right),$$ which would correspond to the matrix $$ M_\alpha^{\circ 2} := \left[\begin{array}{cc} \alpha^2I_m & M \\ M^T & \alpha^2 I_n \end{array}\right].$$ This matrix has total support for $\alpha>0$. However, it is not necessarily fully indecomposable (assume for instance that $M$ has a zero row or column) and, therefore, we can not guarantee the essential uniqueness of the scaling matrices $D_\ell$ and $D_r$. \end{remark} \subsection{The regularized method with prescribed nonhomogeneous common vector for the row and column sums}\label{sec:regularized_rowandcolum} In the nonsquare case, we know from the discussions of Section \ref{sec:nonsquare} that making the column and row sums of $\widetilde M=D_\ell^2MD_r^2$ become equal can not be achieved exactly, where $M$ is the matrix in \eqref{nonneg_nonsquare}. In this case, we can use the regularized method in Theorem \ref{th_scaling}$-c)$ in order to obtain a scaling that balances $\widetilde M$ approximately. We have used this approach on many problems and have obtained pretty satisfactory results. However, since by using this method we always obtain a scalar multiple of a doubly stochastic matrix as solution for $M_\alpha^{\circ 2}$, this method considers in some sense the rows and columns of $M$ in the same way, which is not natural in the rectangular case. Thus, one possible strategy for improving this approach is not to request that $M_\alpha^{\circ 2}$ is scaled to be a scalar multiple of a doubly stochastic matrix but to impose a modified scaling with prescribed common vector \begin{equation} \label{eq.nonhomogv} v:=\left[\begin{array}{c} n\mathbf{1}_m \\ m\mathbf{1}_n \end{array}\right] \end{equation} for the row and column sums. The new regularized method is then described by : \begin{equation}\label{eq:rowsums} \left[\begin{array}{cc} D_\ell^2 & 0 \\ 0& D_r^2 \end{array}\right] M_\alpha^{\circ 2} \left[\begin{array}{cc} D_\ell^2 & 0 \\ 0& D_r^2 \end{array}\right] \left[\begin{array}{c} \mathbf{1}_m \\ \mathbf{1}_n \end{array}\right] =v \end{equation} and \begin{equation}\label{eq:columsums} \left[\begin{array}{cc} \mathbf{1}_m^T & \mathbf{1}_n^T \end{array}\right] \left[\begin{array}{cc} D_\ell^2 & 0 \\ 0& D_r^2 \end{array}\right] M_\alpha^{\circ 2} \left[\begin{array}{cc} D_\ell^2 & 0 \\ 0 & D_r^2 \end{array}\right] = v^{T}. \end{equation} This is a problem that falls into the category of scalings considered in Theorem \ref{RS}. In addition, notice that the matrix $M_\alpha^{\circ 2}$ satisfies the hypotheses in Theorem \ref{th_squareRS} if $\alpha\neq 0$, i.e., $\text{supp}(M_\alpha^{\circ 2})=\text{supp}((M_\alpha^{\circ 2 })^{T}) $ and $(i,i)\in\text{supp}(M_\alpha^{\circ 2})$ for all $i=1,\cdots,n+m$. Then, by considering $\alpha\neq 0$, we know by Theorem \ref{th_squareRS} that there always exists a solution for this modified scaling problem with prescribed common vector for the row and column sums. Moreover, since $M_\alpha^{\circ 2}$ is fully indecomposable \cblu{when $M \ne 0$, according to Lemma \ref{fullyindecomp}, and is symmetric, there exists a unique and bounded diagonal scaling matrix $\diag(D_\ell^2 ,D_r^2)$ solving the problem \eqref{eq:rowsums}-\eqref{eq:columsums}, according again to Theorem \ref{th_squareRS}}. It can also be computed by using the Sinkhorn-Knopp-like algorithm \cblu{given in Appendix A with $r = c = v$, as it converges to the unique solution by Theorem \ref{th_squareRS}. In our numerical experience, this approach very often improves, for rectangular matrices $M$, the results with respect to the approach in Theorem \ref{th_scaling}$-c)$ (corresponding to apply to $M_\alpha^{\circ 2}$ the algorithm in Appendix A with $r = c = {\mathbf{1}}_{m+n}$) in terms of the number of steps until convergence and the quality of the scaling of the obtained matrix.} Notice that, when $\alpha=0$, \cblu{the scaling problem \eqref{eq:rowsums}-\eqref{eq:columsums}} reduces to the problem discussed in Section \ref{sec:nonsquare}. Then, for very small $\alpha$, the regularized scaling with prescribed row and column sums $v$ tends to the scaling problem explained in Section \ref{sec:nonsquare}, which does not always have a solution. In the following example, we illustrate the effect of choosing different values of $\alpha$ and the row and column sum conditions \eqref{eq:rowsums} and \eqref{eq:columsums}. \begin{example} \label{Ex2} \cblu{We remark that, for this example, the algorithm described in Section \ref{sec:nonsquare} converges. More precisely, the algorithm in Appendix A applied to the matrix $M = |A|^{\circ 2}+|B|^{\circ 2}$ with $r = 6\cdot {\mathbf{1}}_5$ and $c = 5 \cdot {\mathbf{1}}_6$ converges. Thus, there is no need to use the regularized method. Nevertheless, we use the regularized method developed in this section with two purposes: (1) for comparing the approximate regularized solution and the exact solution of the optimization problem in Theorem \ref{th:balanceAB} and (2) for illustrating the effect of choosing different values of $\alpha$. We consider again the nonsquare pencil $\lambda B - A$ in Example \ref{Ex1} but now with a preliminary diagonal scaling $\lambda \hat B - \hat A:=\hat D_\ell (\lambda B-A)\hat D_r$ on the left and the right with condition numbers $\kappa(\hat D_\ell) = 12.3$ and $\kappa(\hat D_r)= 2409.1$. The resulting matrix $M:=\hat A^{\circ 2}+\hat B^{\circ 2} $ to be scaled is {\small \begin{equation} \label{eq.matorigex52} M = \left[ \begin{array}{cccccc} 8.983e-06 & 1.145e-09 & 0 & 0 & 0 & 0 \\ 0 & 1.231e-08 & 6.801e-02 & 0 & 0 & 0 \\ 0 & 0 & 4.734e-02 & 1.228e-02 & 0 & 0 \\ 0 & 0 & 0 & 1.977e-03 & 5.170e-04 & 0 \\ 0 & 0 & 0 & 0 & 6.464e-02 & 1 \end{array}\right] \end{equation} } which we normalized to have its largest element equal to $1$. This is a severely unbalanced matrix with quality-factor $q_S (M) = 7.43 \cdot 10^7$, as defined in \eqref{eq.qs}, which combined with the sparsity of the matrix, makes it a difficult problem for the Sinkhorn-Knopp-like algorithm. When applying to $M$ the algorithm in Appendix A with $r = 6\cdot {\mathbf{1}}_5$, $c = 5 \cdot {\mathbf{1}}_6$ and {\tt tol}$= 10^{-3}$, we obtained (with three digits of accuracy) the same result as in Example \ref{Ex1}, i.e., the matrix in \eqref{eq.perfectM5x6}. This indicates that the direct scaling method can compensate for a bad initial scaling. The other results of this unregularized method are displayed in the first line of Table \ref{table.ex53}. We now apply the regularized method with the matrix $M_\alpha^{\circ 2}$ and prescribed common vector $v:=[6,6,6,6,6,5,5,5,5,5,5]^{T}$ for the row and column sums, i.e., the algorithm in Appendix A applied to $M_\alpha^{\circ 2}$ with $r = c = v$ and {\tt tol}$= 10^{-3}$, for three different values of $\alpha$. The results are shown in Table \ref{table.ex53}. These results show that decreasing $\alpha$ in the regularized method improves the quality of the scaling, but makes the diagonal scaling matrices worse conditioned and the convergence slower. Also one can see that the regularization yields considerable improvements of the scaling with respect to the original matrix $M$ with not too small $\alpha$ and with a comparable number of steps to the regularized method (see, for instance, the results for $\alpha = 10^{-3}$). However, the convergence of the regularized method to the unregularized one when $\alpha \rightarrow 0$ is slow. In this example $\alpha = 10^{-5}$ and $steps = 1147$ are needed to get $q_S = 1.004$ with {\tt tol}$= 10^{-3}$. \begin{table}[h!] \cblu{ \begin{center} \caption{Results of the unregularized and the regularized methods applied to the matrix in \eqref{eq.matorigex52} with $r = 6\cdot {\mathbf{1}}_5$ and $c = 5 \cdot {\mathbf{1}}_6$ for the unregularized method, $v$ as in \eqref{eq.nonhomogv} for the regularized method and {\tt tol}$= 10^{-3}$ in all cases. The quality factors $q_S$ should be compared with $q_S (M) = 7.43 \cdot 10^7$} \label{table.ex53} \begin{tabular}{c|c|c|c|c} $\alpha$ & steps & $q_S$ & $\kappa (D^2_\ell)$ & $\kappa (D_r^2) $ \\ \hline 0 & 94 & 1 & 499.3 & 1.1066e+07 \\ $10^{-2}$ & 53 & 844 & 1204.6 & 7330.3 \\ $10^{-3}$ & 99 & 8.04 & 766.4 & 8.5339e+05 \\ $10^{-4}$ & 154 & 1.20 & 501.4 & 7.4396e+06 \\ \end{tabular} \end{center} } \end{table} Finally, as in Example \ref{ex-f51} and based on the same motivations explained there, we show in Table \ref{table.ex53-bis} the results of applying directly to $M$ in \eqref{eq.matorigex52}, the algorithm in Appendix A with $r = 6\cdot {\mathbf{1}}_5$, $c = 5 \cdot {\mathbf{1}}_6$ and the relaxed stopping criterion {\tt tol}$= 1$. The results are extremely good in terms of the speed of convergence and the improvement of the quality of the scaling $q_S$. \begin{table}[h!] \cblu{ \begin{center} \caption{Results of the unregularized Sinkhorn-Knopp-like algorithm applied to the matrix in \eqref{eq.matorigex52} with $r = 6\cdot {\mathbf{1}}_5$, $c = 5 \cdot {\mathbf{1}}_6$ and {\tt tol}$= 1$. The quality factor $q_S$ should be compared with $q_S (M) = 7.43 \cdot 10^7$} \label{table.ex53-bis} \begin{tabular}{c|c|c|c|c} $\alpha$ & steps & $q_S$ & $\kappa (D^2_\ell)$ & $\kappa (D_r^2) $ \\ \hline 0 & 4 & 1.59 & 119.97 & 2.8292e+07 \\ \end{tabular} \end{center} } \end{table} } \end{example} \cblu{As commented in Sections \ref{sec:scaling} and \ref{sec:regular}, in the rectangular case, simple necessary and sufficient conditions on the zero pattern of $M$ for the scaling technique in Section \ref{sec:nonsquare} (i.e., the algorithm in Appendix $A$ applied to $M$ with $r = n {\mathbf{1}}_m$ and $c = m {\mathbf{1}}_n$) to converge are not known (see \cite{Idel,CuturiPeyre} for the state of the art)}. In contrast, the regularized method with the matrix $M_\alpha^{\circ 2}$ and prescribed common vector $v$ in \eqref{eq.nonhomogv} always has a solution for rectangular pencils, and the previous example, as well as many others, shows that it produces satisfactory results, \cblu{even when the unregularized problem has solution}. Therefore, using this new regularized method is \cblu{always an available option for scaling a rectangular $M$, regardless of whether the optimization problem} in Theorem \ref{th:balanceAB} has a solution or not. In Example \ref{Ex2}, we knew that the corresponding matrix $M$ can be scaled with prescribed vectors $r:=[6,6,6,6,6]^{T}$, for the row sums, and $c:=[5,5,5,5,5,5]^{T}$, for the column sums. We now consider the matrix $M$ in Example \ref{ex:nonsquare} that can not be scaled \cblu{to have equal row sums and equal column sums}, but we use the regularized method with prescribed common vector \eqref{eq.nonhomogv} for the row and column sums to obtain an approximate scaling. \cblu{ \begin{example} We consider the nonsquare matrix \begin{equation} \label{eq.matex54} M:=\left[\begin{array}{ccc} 1 & 1 & 1 \\ 0 & 0 & 1\end{array}\right] \end{equation} in Example \ref{ex:nonsquare}, that can not be scaled with prescribed vectors $r:=[3,3]^{T}$, for the row sums, and $c:=[2,2, 2]^{T}$, for the column sums. Therefore, the algorithm in Section \ref{sec:nonsquare}, i.e., the algorithm in Appendix A with this $r$ and $c$, does not converge for this matrix, neither with a stringent stopping criterion {\tt tol}$= 10^{-3}$ nor with the relaxed one {\tt tol}$= 1$ (which shows that {\tt tol}$= 1$ does not always yield convergence). More precisely, we have run this algorithm until $10^4$ steps and it gets stuck, alternating periodically between the following two matrices \[ M_{\infty,1} = \left[ \begin{array}{ccc} 1.5 & 1.5 & 4.9407e-324 \\ 0 & 0 & 3 \end{array} \right] \quad \mbox{and} \quad M_{\infty,2} = \left[ \begin{array}{ccc} 2 & 2 & 4.9407e-324 \\ 0 & 0 & 2 \end{array} \right] . \] Observe that the quality-factors for the homogeneous scalings of the three matrices above are $q_S (M) = 3$ and $q_S (M_{\infty,1}) =q_S (M_{\infty,2}) = 2$, which means that although the un-regularized method does not converge, it has progressed towards a better scaling. Then, we use the regularized approach with different values of $\alpha$ and prescribed common vector $v:=[3,3,2,2,2]^{T}$ for the row and column sums of $M_{\alpha}^{\circ 2}$, i.e., the algorithm in Appendix A applied to $M_{\alpha}^{\circ 2}$ with $r = c = v$ and {\tt tol}$= 10^{-3}$. The results are shown in Table \ref{table.ex54}, where we observe that the regularization yields, even for rather large values of $\alpha$, a significant improvement in the quality of the scaling with a moderate number of steps and well-conditioned $D_\ell$ and $D_r$. In our experiment, $q_S$ reaches quickly a limit value of $1.5$ as $\alpha \rightarrow 0$ with the following corresponding limiting scaled matrix for $\alpha = 10^{-10}$: \[ M_{\alpha \rightarrow 0} = \left[ \begin{array}{ccc} 1.5 & 1.5 & 1.0301e-20 \\ 0 & 0 & 2 \end{array} \right]. \] \begin{table}[h!] \cblu{ \begin{center} \caption{Results of the regularized method applied to the matrix in \eqref{eq.matex54} with $v:=[3,3,2,2,2]^{T}$ and {\tt tol}$= 10^{-3}$ in all cases. The quality factors $q_S$ should be compared with $q_S (M) = 3$} \label{table.ex54} \begin{tabular}{c|c|c|c|c} $\alpha$ & steps & $q_S$ & $\kappa (D^2_\ell)$ & $\kappa (D_r^2) $ \\ \hline 0.5 & 14 & 1.6441 & 10.39 & 8.0413 \\ $10^{-1}$ & 20 & 1.5073 & 198.27 & 148.92 \\ $10^{-2}$ & 29 & 1.5001 & 19422 & 14566 \\ $10^{-4}$ & 45 & 1.5 & 1.9416e+08 & 1.4562e+08 \\ $10^{-10}$ & 93 & 1.5 & 1.9416e+20 & 1.4562e+20 \end{tabular} \end{center} } \end{table} \end{example} } \cblu{We end this section by looking} at the effect of the two sided scaling on the sensitivity of the underlying eigenvalue problem. In the case of regular pencils, we argued \cite{LemVD} \cblu{(see also the discussion in Section \ref{sec:regular})} that the minimization problem $$ \inf_{\det T_\ell \det T_r =1} \| T_\ell (\lambda B - A) T_r \|_F^2 ,$$ over the arbitrary nonsingular matrix pairs $(T_\ell,T_r)$, yielded nearly optimal sensitivity for the generalized eigenvalues of the pencil. But since the eigenvalue problem for a singular pencil is known to be ill-conditioned, this may not make sense anymore. Nevertheless, if we constrain the transformations to be bounded, then the Kronecker structure can not change anymore, and it \cblu{then makes sense} to talk about the sensitivity of the eigenvalues again. In the numerical examples we show that the scaling also improves the sensitivity of the eigenvalues of the regular part of a singular pencil. \section{Numerical examples} \label{sec:numerics} \cblu{In this section, we verify in many numerical tests that the scaling procedures described in Sections \ref{sec:regular}, \ref{sec:nonsquare} and \ref{sec:regularized} indeed improve the accuracy of computed eigenvalues of arbitrary pencils with a much smaller cost than computing the eigenvalues by the $QZ$ or staircase algorithms \cite{QZ,Van79}. All the numerical tests in this paper were performed in MATLAB R2019a. In Subsection \ref{sub:1}, we focus on the computational cost of the scaling procedures, which is much smaller than the cost of computing the eigenvalues as a consequence of the use of the relaxed stopping criterion {\tt tol}$=1$ in the algorithm in Appendix A. In Subsection \ref{sub:2}, we compare the accuracy of the computed eigenvalues of regular pencils without scaling and after the scaling described in Section \ref{sec:regular}. Moreover, we also compare the results with those corresponding to the scaling method of Ward \cite{Ward}, which is the only method currently implemented in LAPACK for scaling regular pencils\footnote{\cblu{Neither MATLAB nor LAPACK \cite{lapack} include built-in functions or routines for computing eigenvalues of singular pencils.}}. This comparison was already performed in \cite{LemVD} but only for regular pencils of dimension $10 \times 10$. Our experiments confirm that the method described in Section \ref{sec:regular}, i.e., that in \cite{LemVD}, outperforms Ward's method, which has a very poor behavior for certain pencils. In Subsection \ref{sub:3}, we perform similar tests on square singular pencils applying either the un-regularized scaling in Section \ref{sec:regular} or, if necessary, the regularized one in Section \ref{sec:regularized} and extract similar conclusions. Finally, in Subsection \ref{sub:secrectangularnum}, we perform tests on rectangular pencils applying either the un-regularized scaling in Section \ref{sec:nonsquare} or, if necessary, the regularized one in Subsection \ref{sec:regularized_rowandcolum}, which improve significantly the accuracy of the computed eigenvalues.} \subsection{The stopping criterion {\tt tol}$=1$, computational cost and regularization} \label{sub:1} \cblu{Given a complex $m\times n$ pencil $\lambda B - A$, all the scaling procedures described in this paper start by constructing the nonnegative matrix $M := |A|^{\circ 2}+|B|^{\circ 2}$. Then, the unregularized methods in Sections \ref{sec:regular} and \ref{sec:nonsquare} apply the algorithm in Appendix A to $M$ with $r = n {\mathbf{1}}_m$ and $c = m {\mathbf{1}}_n$, which in the square case means $r = c = n {\mathbf{1}}_n$. On the other hand, the regularized methods in Section \ref{sec:regularized} apply the algorithm in Appendix A to the nonnegative matrix $M_\alpha^{\circ 2}$ in \eqref{eq:Malpha} with $r = c = (2n) {\mathbf{1}}_{2n}$, when $m=n$, or $r = c = v$ in the rectangular case, where $v$ is the vector in \eqref{eq.nonhomogv}. In both, the unregularized and the regularized methods, one obtains a scaled matrix $\widetilde{M}= D_\ell^2 M D_r^2$, together with the diagonal matrices $D_\ell^2$, $D_r^2$. Then, the scaling process of the pencil finishes in exact arithmetic by computing $D_\ell$, $D_r$, $\widetilde{A}= D_\ell A D_r$ and $\widetilde{B}= D_\ell B D_r$, with the aim of computing the eigenvalues of $\lambda \widetilde{B} - \widetilde{A}$ via some numerical algorithm. However, in real practice this must be applied in a computer and, then, there are rounding errors in the computation of $\widetilde{A}= D_\ell A D_r$ and $\widetilde{B}= D_\ell B D_r$. This implies that the pencils $\lambda B - A$ and $\lambda \widetilde{B} - \widetilde{A}$ are not exactly strictly equivalent to each other and, in the case $D_\ell$ and $D_r$ are ill conditioned as often happens in practice, their eigenvalues may be very different to each other and the process would not be useful for improving the accuracy of computed eigenvalues. In the spirit of the classical reference \cite{Par} (see also \cite{LemVD,Ward}), we can circumvent this difficulty if once $D_\ell$ and $D_r$ have been computed, we replace their diagonal entries by their nearest integer powers of $2$ to get new $D_\ell$ and $D_r$. With these new approximate diagonal scalings, $\widetilde{A}= D_\ell A D_r$ and $\widetilde{B}= D_\ell B D_r$ are computed exactly in floating point arithmetic and $\lambda B - A$ and $\lambda \widetilde{B} - \widetilde{A}$ have exactly the same eigenvalues. Of course, in this way, we do not obtain the same scaled pencil as in exact arithmetic, but it is expected that the obtained one is good enough for improving the accuracy of the computed eigenvalues. The discussion above indicates that for eigenvalue computations, it is not needed to apply the algorithm in Appendix A to either $M$ or $M_\alpha^{\circ 2}$ with a stringent stopping criterion, because we will replace anyway the entries of $D_\ell$ and $D_r$ by their nearest integer powers of $2$. The stopping criterion of the algorithm in Appendix A applied to $M$ used for {\em the updating scaling} $D_{\ell,up}$ and $D_{r,up}$ in the iterative procedure is $$ \max \left\{ 1- \frac{1}{\kappa(D^2_{\ell,up})} , 1- \frac{1}{\kappa(D^2_{r,up})} \right\} < \frac{\mathtt{tol}}{2} $$ in terms of the spectral condition numbers of $D^2_{\ell,up}$ and $D^2_{r,up}$. This is equivalent to $$ \max \left\{ \kappa(D^2_{\ell,up}) \, , \, \kappa(D^2_{r,up}) \right\} < 1 + \frac{\mathtt{tol}}{2- \mathtt{tol}} \, . $$ Thus, {\tt tol}$=1$ implies that the algorithm stops when both $D_{\ell,up}$ and $D_{r,up}$ have a condition number smaller than $\sqrt{2}$. Since we are approximating the final scaling matrices to integer powers of 2, this is a safe stopping criterion for practical purposes. We will use {\tt tol}$=1$ in all the experiments in Subsections \ref{sub:2}, \ref{sub:3} and \ref{sub:secrectangularnum}. In the rest of this subsection, we will present some numerical tests that illustrate the impact of {\tt tol}$=1$ on the reduction of the number of steps that the algorithm in Appendix A needs for convergence and on the regularization of the problem. In all the tables for the experiments in this section ``steps'' denotes the number of steps until convergence, where one step includes one right and one left diagonal scaling. Moreover, $q_S (M_{orig})$ denotes the quality-factor defined in \eqref{eq.qs} for the original matrix $M = |A|^{\circ 2}+|B|^{\circ 2}$ and $q_S (M_{scal})$ the one of the scaled matrix\footnote{\cblu{We emphasize that in all the experiments in Section \ref{sec:numerics}, the matrix $\widetilde{M}$ is computed as $\widetilde{M} = |D_\ell A D_r|^{\circ 2} + |D_\ell B D_r|^{\circ 2}$, where the diagonal matrices $D_\ell$ and $D_r$ are the ones whose diagonal entries are integer powers of $2$.}} $\widetilde{M}= D_\ell^2 M D_r^2$. The ideal goal of all our scalings procedures is to make the row sums of $\widetilde{M}$ as equal as possible and its column sums as equal as possible as well, i.e, to get $q_S (M_{scal}) \approx 1$. As discussed in previous sections, we know that this is not always possible in exact arithmetic. In addition, even when it is possible in exact arithmetic, the use of entries that are integer powers of $2$ in $D_\ell$ and $D_r$ prevents to get such a goal. Thus, the practical goal is to get that $q_S (M_{scal})$ is much closer to $1$ than $q_S (M_{orig})$. In our first test, we chose pencils of dimension $n\times n$ with $n=400, 800, 1200, 1600,$ $2000$ and with elements that were generated using MATLAB's {\tt randn} function elevated to power 20, yielding matrices $M$ with row and column sums strongly unbalanced. For each size $n$, we ran the algorithm in Appendix A with $r = c = n {\mathbf{1}}_n$ on ten random pencils and averaged the different tested magnitudes, both with {\tt tol}$= 1$ and {\tt tol}$= 10^{-3}$ and, in both cases, approximating $D_\ell$ and $D_r$ by their nearest integer powers of $2$. The results are shown in Table \ref{tab:table61-fro}. We emphasize that in this test, regularization is not needed because the random generation used for $A$ and $B$ imply that the entries of $M$ are almost always different from zero and, thus, $M$ has total support. Observe, that {\tt tol}$= 1$ yields a much faster convergence and similar values of $q_S (M_{scal})$ than {\tt tol}$= 10^{-3}$, which is very slow on this highly unbalanced matrices. Moreover, the number of required iteration steps does not grow with the dimension of the pencils. Since each step of the scaling procedure costs $O(n^2)$ flops, while the cost of computing the eigenvalues of an $n \times n$ pencil with the $QZ$ algorithm is $30 n^3$ flops \cite[Section 7.7]{GoVL}, we conclude that for the matrices in this test the computational cost of the scaling procedure with {\tt tol}$= 1$ is much smaller than the cost of computing the eigenvalues. } \begin{table}[h!] \begin{center} \cblu{ \caption{Numerical test illustrating that the use of {\tt tol}$= 1$ decreases very much the number of steps without affecting to the quality of the scaling of the achieved scaled matrix $\widetilde{M}$ nor to the condition numbers of $D_\ell$ and $D_r$. The algorithm in Appendix A with $r = c = n {\mathbf{1}}_n$ has been applied to the matrices $M$ of exactly the same set of $n\times n$ pencils generated in {\rm MATLAB} as {\tt A=randn(n,n).}\!\!\^ {\tt (20)} and {\tt B=randn(n,n).}\!\!\^{\tt (20)}, one time with {\tt tol}$= 1$ and another time with {\tt tol}$= 10^{-3}$. No regularization is used, which is indicated with $\alpha =0$} \label{tab:table61-fro} {\small \begin{tabular}{c|c||c|c|c|c||} & & \multicolumn{4}{c||}{{\tt tol}$= 1$ and $\alpha =0$} \\ \hline $n$ & $q_S(M_{orig})$ & $q_S (M_{scal})$ & $\kappa (D_\ell)$ & $\kappa (D_r)$ & steps \\ \hline 400 & 1.94e+10 & 1.24e+01 & 2.76e+03 & 4.30e+04 & 9.8 \\ 800 & 4.90e+09 & 1.37e+01 & 2.46e+03 & 2.54e+04 & 10 \\ 1200 & 1.12e+10 & 1.35e+01 & 2.97e+03 & 1.35e+04 & 10.9 \\ 1600 & 2.79e+09 & 1.37e+01 & 2.56e+03 & 1.23e+04 & 10.7 \\ 2000 & 4.07e+09 & 1.42e+01 & 2.00e+03 & 1.37e+04 & 10.8 \end{tabular} \vspace*{0.3cm} \begin{tabular}{c|c||c|c|c|c||} & & \multicolumn{4}{c||}{{\tt tol}$= 10^{-3}$ and $\alpha =0$} \\ \hline $n$ & $q_S(M_{orig})$ & $q_S (M_{scal})$ & $\kappa (D_\ell)$ & $\kappa (D_r)$ & steps \\ \hline 400 & 1.94e+10 & 1.18e+01 & 1.11e+04 & 1.64e+04 & 1367.5 \\ 800 & 4.90e+09 & 1.20e+01 & 5.53e+03 & 8.70e+03 & 1616 \\ 1200 & 1.12e+10 & 1.26e+01 & 7.17e+03 & 7.27e+03 & 1470.7 \\ 1600 & 2.79e+09 & 1.27e+01 & 6.14e+03 & 4.30e+03 & 1323.3 \\ 2000 & 4.07e+09 & 1.27e+01 & 5.32e+03 & 5.94e+03 & 1382.4 \end{tabular} } } \end{center} \end{table} \cblu{ Our second test is organized in the same way as that in Table \ref{tab:table61-fro}, but the generated matrices $A$ and $B$ are sparse, with only around 1 \% of their entries different from zero. They are generated as described in the caption of Table \ref{tab:table62-fro}. The sparsity of the corresponding $M$ matrices imply that they may have not often total support. In fact, the algorithm in Appendix A with $r = c = n {\mathbf{1}}_n$ has not converged in 2000 steps for any of the matrices $M$ generated in this test with {\tt tol}$= 10^{-3}$. This indicates that a regularization would be needed in {\em exact arithmetic} for these pencils. However, the algorithm has always converged rather quickly with {\tt tol}$= 1$, yielding, moreover, very satisfactory scalings as measured by $q_S (M_{scal})$. The results are shown in Table \ref{tab:table62-fro}. This test is just one example of a phenomenon that we have observed very often, namely, that the use of {\tt tol}$= 1$ has very often a regularization effect that makes it unnecessary to use, for computing accurate eigenvalues of pencils, the regularization techniques in Section \ref{sec:regularized}. We announced this phenomenon in Example \ref{ex-f51}, but we have observed it in many other cases where the matrix $M$ does not have total support and it has led us to make the comments in Remark \ref{rem.regular}. Observe that the convergence in Table \ref{tab:table62-fro} is slower than in Table \ref{tab:table61-fro}. As we discuss below, this is due to the fact that the values of $q_S (M_{orig})$ are larger, but also due to the larger sparsity. } \begin{table}[h!] \begin{center} \cblu{ \caption{Numerical test illustrating that the use of {\tt tol}$= 1$ has often a regularizing effect. The algorithm in Appendix A with $r = c = n {\mathbf{1}}_n$ has been applied to the matrices $M$ of $n\times n$ pencils generated in {\rm MATLAB} as {\tt A=eye(n) +sprandn(n,n,0.01).}\!\!\^ {\tt (20)} and {\tt B=eye(n) + sprandn(n,n,0.01).}\!\!\^{\tt (20)} with {\tt tol}$= 1$, and the results are shown in the table. In contrast, the same algorithm applied to the same set of pencils with {\tt tol}$= 10^{-3}$ does not converge in 2000 steps for any of the generated matrices. The same happens if the power $20$ is replaced by $10$.} \label{tab:table62-fro} {\small \begin{tabular}{c|c||c|c|c|c||} & & \multicolumn{4}{c||}{{\tt tol}$= 1$ and $\alpha =0$} \\ \hline $n$ & $q_S(M_{orig})$ & $q_S (M_{scal})$ & $\kappa (D_\ell)$ & $\kappa (D_r)$ & steps \\ \hline 400 & 2.58e+22 & 1.33e+01 & 9.19e+16 & 1.27e+17 & 40.5 \\ 800 & 3.29e+24 & 1.40e+01 & 2.72e+14 & 3.74e+15 & 33.9 \\ 1200 & 9.25e+25 & 1.47e+01 & 2.89e+11 & 2.97e+13 & 27.8 \\ 1600 & 2.31e+26 & 1.51e+01 & 2.34e+11 & 1.11e+12 & 28.4 \\ 2000 & 3.76e+22 & 1.51e+01 & 2.34e+10 & 1.61e+11 & 26 \end{tabular} } } \end{center} \end{table} \cblu{ Our third test is organized as the previous ones. The test pencils are in this case random permutations of square block diagonal pencils with rectangular diagonal blocks. They are generated as described in the caption of Table \ref{tab:table63-fro}. None of the corresponding $M$ matrices has in this case total support. The key difference with respect to the tests in Tables \ref{tab:table61-fro} and \ref{tab:table62-fro} is that in this case the algorithm in Appendix A with {\tt tol}$= 1$ and $r = c = n {\mathbf{1}}_n$ applied to the matrices $M$ never converges in 2000 steps, i.e., {\tt tol}$= 1$ does not have a regularizing effect for these pencils. Thus, the use of the regularization is mandatory in this case. The results are shown in Table \ref{tab:table63-fro}. We emphasize two main points on the results. First, though the obtained values for $q_S (M_{scal})$ are much better than those of $q_S (M_{orig})$, they are far from $1$. Moreover, the values of $q_S (M_{scal})$ do not improve by decreasing the value of $\alpha$. Despite these facts, we will see in some experiments done in Subsection \ref{sub:3} on similar pencils, that the regularized scaling has significant positive effects on the accuracy of the computed eigenvalues.} \begin{table}[h!] \begin{center} \cblu{ \caption{Numerical test illustrating pencils where the regularization is mandatory even if {\tt tol}$= 1$ is used. The algorithm in Appendix A with $r = c = n {\mathbf{1}}_n$ applied to the matrices $M$ of $n\times n$ pencils generated in {\rm MATLAB} as random permutations of {\tt A = blkdiag(randn(n1,n2).}\!\!\^ {\tt (20) , randn(n2,n1).}\!\!\^ {\tt (20))} and {\tt B = blkdiag(randn(n1,n2).}\!\!\^ {\tt (20) , randn(n2,n1).}\!\!\^ {\tt (20))} with {\tt n1 = n/5} and {\tt n2 = n - n1} does not converge in 2000 steps with {\tt tol}$= 1$. The same happens if the exponent 20 is replaced by 10 or 5. In contrast, the algorithm in Appendix A with $r = c = (2 n) {\mathbf{1}}_{2 n}$ applied to the matrices $M_\alpha^{\circ 2}$ in \eqref{eq:Malpha} with {\tt tol}$= 1$ and $\alpha = 0.5, 10^{-4}$ converges and the results are shown below. We have checked that the use of smaller values of $\alpha$ does not improve the quality of the achieved scaling, but worsens the condition numbers of $D_\ell$ and $D_r$ and increases the number of steps until convergence} \label{tab:table63-fro} {\small \begin{tabular}{c|c||c|c|c|c||} & & \multicolumn{4}{c||}{{\tt tol}$= 1$ and $\alpha =0.5$} \\ \hline $n$ & $q_S(M_{orig})$ & $q_S (M_{scal})$ & $\kappa (D_\ell)$ & $\kappa (D_r)$ & steps \\ \hline 200 & 1.59e+15 & 1.75e+09 & 3.74e+12 & 3.30e+12 & 32.8 \\ 400 & 2.14e+14 & 4.93e+07 & 1.94e+13 & 6.77e+13 & 34.5 \\ 600 & 9.30e+13 & 6.64e+06 & 1.37e+14 & 5.63e+13 & 33.6 \\ 800 & 1.20e+13 & 3.45e+06 & 1.20e+14 & 1.13e+14 & 33.0 \\ 1000 & 4.72e+12 & 4.57e+06 & 1.48e+14 & 1.41e+14 & 34.0 \end{tabular} \vspace*{0.3cm} \begin{tabular}{c|c||c|c|c|c||} & & \multicolumn{4}{c||}{{\tt tol}$= 1$ and $\alpha = 10^{-4}$} \\ \hline $n$ & $q_S(M_{orig})$ & $q_S (M_{scal})$ & $\kappa (D_\ell)$ & $\kappa (D_r)$ & steps \\ \hline 200 & 1.59e+15 & 1.83e+09 & 2.25e+16 & 1.46e+16 & 39.5 \\ 400 & 2.14e+14 & 5.42e+07 & 9.01e+16 & 5.22e+17 & 41.0 \\ 600 & 9.30e+13 & 4.97e+06 & 6.20e+17 & 2.59e+17 & 40.0 \\ 800 & 1.20e+13 & 3.72e+06 & 5.04e+17 & 4.76e+17 & 39.1 \\ 1000 & 4.72e+12 & 5.20e+06 & 7.21e+17 & 5.76e+17 & 40.1 \end{tabular} } } \end{center} \end{table} \cblu{ We finish this subsection with two additional tests. The first one is described and reported in Table \ref{tab:table64-fro} and is as the one in Table \ref{tab:table61-fro} but with starting matrices $M$ that are less strongly unbalanced as measured by $q_S(M_{orig})$. This leads to a much faster convergence than in Table \ref{tab:table61-fro}, as it is naturally expected. The comparison of Tables \ref{tab:table61-fro} and \ref{tab:table64-fro} shows that the number of steps until converges grows with the unbalancing of the $M$ matrices but, also, that is independent of the dimension of the matrices. The last test is described and reported in Table \ref{tab:table65-fro} and is as the one in Table \ref{tab:table62-fro} but with sparse starting matrices $M$ that are less strongly unbalanced, which lead again to a much faster convergence, independent, more or less, of the dimension of the matrices. The comparison of Table \ref{tab:table61-fro} (for {\tt tol}$= 1$), for dense pencils, and of Table \ref{tab:table65-fro}, for sparse pencils, is interesting because both show similar values of $q_S(M_{orig})$ but the convergence is slower in the sparse case. This illustrates that for {\tt tol}$= 1$, the well-known effect that sparsity slows down the convergence of the Sinkhorn-Knopp algorithm also holds \cite{Knight}.} \begin{table}[h!] \begin{center} \cblu{ \caption{Numerical test equal to that in Table \ref{tab:table61-fro} for {\tt tol}$= 1$ except for the fact that the $n\times n$ pencils are generated in {\rm MATLAB} as {\tt A=randn(n,n).}\!\!\^ {\tt (10)} and {\tt B=randn(n,n).}\!\!\^{\tt (10)}. The use of the exponent 10 instead of 20 in the generation of the test matrices implies that the original matrices $M$ are better equilibrated than those in Table \ref{tab:table61-fro}, as indicated by the values of $q_S(M_{orig})$, which, in turns, implies a faster convergence in approximately half of the steps} \label{tab:table64-fro} {\small \begin{tabular}{c|c||c|c|c|c||} & & \multicolumn{4}{c||}{{\tt tol}$= 1$ and $\alpha =0$} \\ \hline $n$ & $q_S(M_{orig})$ & $q_S (M_{scal})$ & $\kappa (D_\ell)$ & $\kappa (D_r)$ & steps \\ \hline 400 & 4.04e+04 & 1.11e+01 & 3.84e+01 & 8.64e+01 & 5.1 \\ 800 & 1.75e+04 & 1.07e+01 & 2.72e+01 & 6.40e+01 & 5.0 \\ 1200 & 1.78e+04 & 1.12e+01 & 2.24e+01 & 5.12e+01 & 5.1 \\ 1600 & 1.37e+04 & 1.13e+01 & 2.72e+01 & 4.80e+01 & 4.8 \\ 2000 & 1.42e+04 & 1.15e+01 & 2.40e+01 & 5.12e+01 & 5.0 \end{tabular} } } \end{center} \end{table} \begin{table}[h!] \begin{center} \cblu{ \caption{Numerical test equal to that in Table \ref{tab:table62-fro} except for the fact that the $n\times n$ pencils are generated in {\rm MATLAB} as {\tt A=eye(n) + sprandn(n,n,0.01).}\!\!\^ {\tt (10)} and {\tt B=eye(n) + sprandn(n,n,0.01).}\!\!\^{\tt (10)}. The use of the exponent 10 instead of 20 in the generation of the test matrices implies that the original matrices $M$ are better equilibrated than those in Table \ref{tab:table62-fro}, as indicated by the values of $q_S(M_{orig})$, which, in turns, implies a faster convergence in approximately half of the steps} \label{tab:table65-fro} {\small \begin{tabular}{c|c||c|c|c|c||} & & \multicolumn{4}{c||}{{\tt tol}$= 1$ and $\alpha =0$} \\ \hline $n$ & $q_S(M_{orig})$ & $q_S (M_{scal})$ & $\kappa (D_\ell)$ & $\kappa (D_r)$ & steps \\ \hline 400 & 8.87e+10 & 1.31e+01 & 1.96e+08 & 1.85e+08 & 20.6 \\ 800 & 1.04e+12 & 1.38e+01 & 8.07e+06 & 1.93e+07 & 17.1 \\ 1200 & 3.96e+12 & 1.41e+01 & 3.87e+05 & 3.04e+06 & 14.3 \\ 1600 & 3.39e+12 & 1.42e+01 & 3.28e+05 & 5.24e+05 & 14.5 \\ 2000 & 1.12e+11 & 1.54e+01 & 8.19e+04 & 2.29e+05 & 13.1 \end{tabular} } } \end{center} \end{table} \cblu{As a summary of the results in this subsection, we emphasize that, even for pencils leading to extremely unbalanced matrices $M$, the computational cost of the scaling procedures proposed in this paper with the stopping criterion {\tt tol}$= 1$ is much smaller than the cost of computing the eigenvalues. For brevity, results on rectangular pencils are delayed until Section \ref{sub:secrectangularnum}.} \cblu{ \subsection{Examples on the accuracy of computed eigenvalues of regular pencils} \label{sub:2} In this section, we discuss numerical tests for three families of regular pencils. In each of these families, we generated random diagonalizable $n \times n$ regular pencils $\lambda B- A$ for which their ``exact'' eigenvalues $\lambda_i$ were known. Then, we applied the $QZ$-algorithm \cite{QZ} in MATLAB to such pencils, to the scaled pencils $D_\ell(\lambda B-A)D_r$ obtained by applying the algorithm in Appendix A with $r=c= n {\mathbf{1}}_n$ and {\tt tol}$=1$ to $M = |A|^{\circ 2}+|B|^{\circ 2}$, and to the pencils balanced by Ward's method \cite{Ward}. In all cases, we constrained the diagonal elements of the diagonal scaling matrices to be integer powers of two. Since MATLAB does not have a built-in function implementing Ward's method, we used the one in \cite{Weder}. For each generated pencil, we compared the ``exact'' eigenvalues $\lambda_i$ of the pencil with the eigenvalues $\tilde \lambda_i$ computed via the three options described above. For the comparison of the eigenvalues, we used their chordal distances \cite{Stewart-Sun} $$c_i := \chi(\lambda_i,\tilde \lambda_i) := \frac{|\lambda_i-\tilde\lambda_i|}{\sqrt{1+|\lambda_i|^2}\sqrt{1+|\tilde\lambda_i|^2}}.$$ We compared the quantities $c :=\|[c_1,\ldots, c_n]\|_2$ for the original pencil $(\lambda B-A)$ ($c_{orig}$), for the balanced pencil $D_\ell(\lambda B-A)D_r$ constructed by applying the algorithm in Appendix A with $r=c= n {\mathbf{1}}_n$ and {\tt tol}$=1$ to $M$ $(c_{bal}$) and for the balanced pencil constructed by Ward's method $(c_{ward}$). The regularization techniques of Section \ref{sec:regularized} were not used in this section since the algorithm in Appendix A applied to $M$ with {\tt tol}$=1$ always converged in a very small number of steps, as can be seen in the tables of this subsection. In fact, we have not found any {\em regular} pencil where the algorithm in Appendix A with $r=c= n {\mathbf{1}}_n$ and {\tt tol}$=1$ applied to $M$ does not converge in a small number of steps, even considering very sparse regular pencils.} \cblu{In the first family of tests of this subsection, we generated $500 \times 500$ random diagonalizable pencils of the form $T_\ell(\lambda \Lambda_B- \Lambda_A)T_r$ where $(\lambda \Lambda_B- \Lambda_A)$ is in standard normal form \cite{LemVD}, i.e., $\Lambda_A$ and $\Lambda_B$ are diagonal, and $|\Lambda_A|^2 + |\Lambda_B|^2 = I_n$. The condition number of the random square nonsingular matrices $T_\ell$ and $T_r$ was controlled by taking the $k$th power of normally distributed random numbers $r_{ij}$ as their elements. A larger power $k$ then typically yields a larger condition number. The obtained results are shown in Table \ref{tab:table66-fro}, where each row corresponds to a value of $k$ taken in increasing order from $k = 1:5:41$ in MATLAB notation. This experiment shows that the scaling proposed in Section \ref{sec:regular} based on the algorithm in Appendix A does improve the accuracy of the computed eigenvalues with respect to the original pencil and to the pencil scaled by Ward's method, especially when the pencil corresponds to badly conditioned left and right diagonalizing transformations $T_\ell$ and $T_r$. Moreover, we see that the algorithm in Appendix A converged in a very small number of steps and produced a very well scaled matrix $\widetilde{M}$.} \begin{table}[h!] \begin{center} \cblu{ \caption{Eigenvalue accuracy of the $QZ$-algorithm for regular $500 \times 500$ pencils: for the original pencil, for the pencil balanced by applying the algorithm in Appendix A with $r=c= n {\mathbf{1}}_n$ and {\tt tol}$=1$ to $M = |A|^{\circ 2}+|B|^{\circ 2}$, and for the pencil balanced by Ward's method. The improvement in the scaling of $M$ produced by the algorithm in Appendix A is also shown in terms of $q_S(M_{orig})$ and $q_S (M_{scal})$ (see \eqref{eq.qs}), as well as the number of its steps until convergence} \label{tab:table66-fro} {\small \begin{tabular}{c|c|c|c|c|c|c} $\kappa(T_\ell)$ & $\kappa(T_r)$ & $c_{orig}$ & $c_{bal}$ & $c_{ward}$ & $c_{bal}/c_{orig}$ & $c_{bal}/c_{ward}$ \\ \hline 2.45e+03 & 1.03e+03 & 7.42e-13 & 7.42e-13 & 7.19e-13 & 1.00e+00 & 1.03e+00 \\ 4.11e+03 & 4.20e+03 & 5.29e-13 & 4.25e-13 & 4.61e-13 & 8.03e-01 & 9.22e-01 \\ 2.01e+05 & 5.26e+04 & 1.59e-11 & 4.89e-12 & 5.33e-12 & 3.08e-01 & 9.17e-01 \\ 4.25e+07 & 3.87e+06 & 9.94e-10 & 1.92e-11 & 2.28e-10 & 1.93e-02 & 8.39e-02 \\ 4.55e+08 & 2.83e+07 & 2.09e-08 & 1.07e-10 & 2.07e-09 & 5.13e-03 & 5.20e-02 \\ 7.47e+10 & 2.62e+10 & 1.19e-05 & 5.67e-08 & 8.97e-06 & 4.76e-03 & 6.31e-03 \\ 9.18e+11 & 7.91e+11 & 2.57e-03 & 1.96e-05 & 1.16e-03 & 7.63e-03 & 1.69e-02 \\ 5.31e+14 & 1.29e+14 & 4.80e-01 & 3.44e-06 & 7.40e-03 & 7.18e-06 & 4.65e-04 \\ 9.66e+16 & 5.23e+14 & 1.33e-01 & 2.20e-03 & 2.09e-01 & 1.65e-02 & 1.05e-02 \end{tabular} \vspace*{0.3cm} \begin{tabular}{c|c|c} $q_S(M_{orig})$ & $q_S (M_{scal})$ & steps \\ \hline 1.62e+00 & 1.62e+00 & 1 \\ 4.25e+03 & 5.73e+00 & 4 \\ 1.11e+06 & 9.03e+00 & 5 \\ 9.32e+09 & 1.16e+01 & 9 \\ 6.12e+11 & 1.01e+01 & 12 \\ 7.54e+16 & 9.97e+00 & 14 \\ 5.57e+18 & 1.18e+01 & 17 \\ 5.15e+24 & 1.07e+01 & 23 \\ 3.53e+26 & 1.35e+01 & 21 \end{tabular}} } \end{center} \end{table} \cblu{It is well known that Ward's method can severely deteriorate the accuracy of the computed eigenvalues of some pencils \cite[Ch. 2, Sect. 4.2]{kressner}, \cite{LemVD}. In the second family of tests of this subsection, we generated a family of $500 \times 500$ pencils where Ward's method led to computed eigenvalues with large errors but the method in Section \ref{sec:regular} performed very well in accuracy and convergence rate. We emphasize that we have not been able to generate pencils with the opposite behavior. The pencils were generated as follows: (1) a random $500 \times 500$ matrix $T$ was constructed with the MATLAB command {\tt randn}; (2) small entries were created in $T$ with $T(1,2:500) = 10^{-k} T(1,2:500)$ and $T(4:500,3) = 10^{-k} T(4:500,3)$; (3) take $A = T D$, with $D$ a random diagonal matrix of integer positive numbers, and $B = T$. Observe that the eigenvalues of $\lambda B - A$ are precisely the diagonal entries of $D$. The results are shown in Table \ref{tab:table67-fro}, where each row corresponds to a value of $k$ taken from $k = 1:2:11$ in MATLAB notation. } \begin{table}[h!] \begin{center} \cblu{ \caption{Eigenvalue accuracy of the $QZ$-algorithm for regular $500 \times 500$ pencils for which Ward's method deteriorates the precision of computed eigenvalues: for the original pencil, for the pencil balanced by applying the algorithm in Appendix A with $r=c= n {\mathbf{1}}_n$ and {\tt tol}$=1$ to $M$, and for the pencil balanced by Ward's method} \label{tab:table67-fro} {\small \begin{tabular}{c|c|c|c|c|c|c} k & $c_{orig}$ & $c_{bal}$ & $c_{ward}$ & $c_{bal}/c_{orig}$ & $c_{bal}/c_{ward}$ & $c_{ward}/c_{orig}$\\ \hline 1 & 2.61e-13 & 3.40e-15 & 8.87e-15 & 1.31e-02 & 3.84e-01 & 3.40e-02 \\ 3 & 1.48e-13 & 7.59e-15 & 1.91e-14 & 5.14e-02 & 3.98e-01 & 1.29e-01 \\ 5 & 4.13e-13 & 8.72e-15 & 4.56e-09 & 2.11e-02 & 1.91e-06 & 1.10e+04 \\ 7 & 7.16e-14 & 2.27e-15 & 3.47e-02 & 3.17e-02 & 6.54e-14 & 4.84e+11 \\ 9 & 3.90e-13 & 3.01e-15 & 1.05e+00 & 7.72e-03 & 2.87e-15 & 2.69e+12 \\ 11 & 1.34e-13 & 7.99e-15 & 1.08e+00 & 5.96e-02 & 7.38e-15 & 8.08e+12 \end{tabular} \vspace*{0.3cm} \begin{tabular}{c|c|c} $q_S(M_{orig})$ & $q_S (M_{scal})$ & steps \\ \hline 5.11e+04 & 4.02e+00 & 2 \\ 1.16e+05 & 4.33e+00 & 3 \\ 1.43e+05 & 4.33e+00 & 3 \\ 6.40e+03 & 4.50e+00 & 3 \\ 1.47e+05 & 4.73e+00 & 3 \\ 1.37e+05 & 4.74e+00 & 3 \end{tabular}} } \end{center} \end{table} \cblu{In the experiments presented so far in this subsection, the scaling method in Section \ref{sec:regular} always improved significantly the accuracy of the computed eigenvalues with respect to the original unscaled pencil. However, there are pencils where the improvement is much larger. This is illustrated in the last family of tests of this subsection. The pencils were constructed as those in the experiment of Table \ref{tab:table66-fro}, i.e., $T_\ell(\lambda \Lambda_B- \Lambda_A)T_r$, but with different $T_\ell$ and $T_r$. In this case, $T_\ell = D_1 Q_\ell$ and $T_r = Q_r D_2$, with $Q_\ell$ and $Q_r$ random orthogonal matrices and $D_1$ and $D_2$ random diagonal matrices with condition numbers $10^k$ and geometrically distributed singular values, constructed with the command {\tt gallery('randsvd',...)} of MATLAB. The results are shown in Table \ref{tab:table68-fro} for $1000 \times 1000$ pencils and $k = 1, 10, 19$ (each value for each row of the table). Ward's method also yields very accurate eigenvalues. } \begin{table}[h!] \begin{center} \cblu{ \caption{Eigenvalue accuracy of the $QZ$-algorithm for regular $1000 \times 1000$ pencils for which the method based on the algorithm in Appendix A applied to $M$ and Ward's method work both very well} \label{tab:table68-fro} {\small \begin{tabular}{c|c|c|c|c|c|c|c} $c_{orig}$ & $c_{bal}$ & $c_{ward}$ & $\!\! c_{bal}/c_{orig}\!\!$ & $\!\! c_{bal}/c_{ward} \!\!$ & $q_S(M_{orig})$ & $\!\! q_S (M_{scal}) \!\!$ & \!\! steps \!\! \\ \hline 5.27e-14 & 5.33e-14 & 5.17e-14 & 1.01e+00 & 1.03e+00 & 1.12e+02 & 4.13e+00 & 2\\ 4.47e-06 & 5.23e-14 & 5.77e-14 & 1.17e-08 & 9.05e-01 & 1.65e+20 & 4.21e+00 & 3 \\ 1.33e+01 & 6.49e-14 & 6.41e-14 & 4.86e-15 & 1.01e+00 & 1.53e+38 & 4.13e+00 & 3 \end{tabular}} } \end{center} \end{table} \cblu{As a consequence of the results in this subsection, we emphasize again that the scaling method in Section \ref{sec:regular}, i.e., that in \cite{LemVD}, often contributes to improve the accuracy of computed eigenvalues of regular pencils significantly and outperforms the method of Ward \cite{Ward}, which is the only one available so far in LAPACK \cite{lapack}.} \cblu{ \subsection{Examples on the accuracy of computed eigenvalues of singular square pencils} \label{sub:3} In this section, we discuss tests for two families of singular square pencils. The first family includes dense pencils for which the regularization in Section \ref{sec:regularized} is not needed, while the second one corresponds to sparse pencils for which the regularization is necessary. For completeness, Ward's method is also considered in the comparisons, because, although it was developed for regular pencils, it has worked on the singular ones of this subsection. As in Subsection \ref{sub:2}, we generated random singular pencils whose ``exact'' eigenvalues are known and we used the vectors of chordal distances, $c :=\|[c_1,\ldots, c_n]\|_2$ for the original pencil $(\lambda B-A)$ ($c_{orig}$), for the balanced pencil $D_\ell(\lambda B-A)D_r$ constructed by the methods in either Section \ref{sec:regular} or \ref{sec:regularized}, and for the balanced pencil constructed by Ward's method $(c_{ward}$), in order to check the improvements that the different scalings produced on the accuracy of the computed eigenvalues.} \cblu{The first family of dense pencils considered in this subsection is constructed in the same way as the pencils in Table \ref{tab:table66-fro}, but} we replaced one of the diagonal pairs of the \cblu{$500 \times 500$} pencil $(\lambda \Lambda_B- \Lambda_A)$ generated in the regular example by two zeros, \cblu{thus creating} a singular pencil. Each transformed pencil $(\lambda B -A) := T_\ell(\lambda \Lambda_B- \Lambda_A)T_r$ is therefore also singular, but its left and right rational null spaces are both of dimension 1 and their minimal bases are formed by constant vectors \cite{Van79}. For that reason, the regular part of that singular pencil has dimension \cblu{$499\times 499$} and its eigenvalues are the remaining \cblu{499} eigenvalues of $(\lambda \Lambda_B- \Lambda_A)$. If we follow the same procedure as in the \cblu{regular} experiment, the $QZ$-algorithm applied to $(\lambda B -A)$ should in principle yield arbitrary eigenvalues, since it is known that the $QZ$-algorithm is backward stable and that there exist arbitrarily small perturbations of square singular pencils that make them regular, but with arbitrary spectrum in the complex plane \cite{Van79}. However, it has been shown that such perturbations are very particular, and that, generically, tiny perturbations of a singular square pencil makes it regular with eigenvalues that are tiny perturbations of the eigenvalues of the unperturbed singular pencil, together with some other ``arbitrary'' eigenvalues determined by the perturbation \cite{detedop2010,detedop2008}. Even more, starting from these ideas, it has been shown very recently that it is possible to define sensible and useful ``weak'' condition numbers for the eigenvalues of a singular square pencil \cite{LotN20}. This explains the well-known fact that, in practice, the $QZ$-algorithm applied to a singular square matrix pencil finds almost always its eigenvalues, albeit with some loss of accuracy. Therefore, it makes sense to apply the $QZ$ algorithm to our generated singular pencils as well as to their scaled versions. The numerical results are reported in \cblu{Table \ref{tab:table69-fro}, where each row corresponds to a value of $k$ taken in increasing order from $k = 1 : 5 : 41$ as in Table \ref{tab:table66-fro}}. We generated the data just as in the \cblu{experiment for regular pencils in Table \ref{tab:table66-fro}}, except for the one eigenvalue replaced by $0/0$ or, in other words, by NaN. When comparing the ``original'' spectrum with the computed one, we excluded NaN in the original set and looked for the best matching \cblu{499} eigenvalues in the ``computed'' spectrum. \cblu{It is clear from Table \ref{tab:table69-fro} that the balancing proposed in Section \ref{sec:regular} also improves the accuracy of the computed eigenvalues of singular square pencils, both with respect to the original pencil and with respect to the one balanced by Ward's method, and that needs a small number of steps to converge.} \begin{table}[h!] \begin{center} \cblu{ \caption{Eigenvalue accuracy of the plain $QZ$-algorithm for singular $500 \times 500$ dense pencils: for the original pencil, for the pencil balanced by applying the algorithm in Appendix A with $r=c= n {\mathbf{1}}_n$ and {\tt tol}$=1$ to $M = |A|^{\circ 2}+|B|^{\circ 2}$, and for the pencil balanced by Ward's method. The improvement in the scaling of $M$ produced by the algorithm in Appendix A is also shown in terms of $q_S(M_{orig})$ and $q_S (M_{scal})$ (see \eqref{eq.qs}), as well as the number of its steps until convergence} \label{tab:table69-fro} {\small \begin{tabular}{c|c|c|c|c|c|c} $\kappa(T_\ell)$ & $\kappa(T_r)$ & $c_{orig}$ & $c_{bal}$ & $c_{ward}$ & $c_{bal}/c_{orig}$ & $c_{bal}/c_{ward}$ \\ \hline 4.30e+03 & 4.10e+03 & 1.88e-12 & 1.88e-12 & 8.27e-12 & 1.00e+00 & 2.28e-01 \\ 1.69e+04 & 2.12e+04 & 1.77e-11 & 1.85e-12 & 6.17e-12 & 1.04e-01 & 2.99e-01 \\ 1.06e+06 & 9.83e+04 & 1.88e-11 & 1.19e-11 & 5.04e-12 & 6.34e-01 & 2.37e+00 \\ 7.47e+05 & 2.73e+06 & 1.98e-10 & 1.40e-10 & 7.13e-11 & 7.08e-01 & 1.97e+00 \\ 1.20e+08 & 6.49e+08 & 1.62e-08 & 4.13e-11 & 4.13e-09 & 2.55e-03 & 9.99e-03 \\ 2.32e+10 & 2.75e+09 & 5.20e-07 & 5.00e-09 & 2.15e-07 & 9.62e-03 & 2.33e-02 \\ 3.59e+13 & 2.59e+12 & 3.25e-03 & 2.83e-07 & 5.40e-05 & 8.71e-05 & 5.24e-03 \\ 1.63e+16 & 3.03e+13 & 3.46e-02 & 3.55e-05 & 3.84e-03 & 1.03e-03 & 9.25e-03 \\ 1.63e+18 & 1.48e+14 & 8.15e-02 & 9.12e-06 & 1.22e-02 & 1.12e-04 & 7.46e-04 \end{tabular} \vspace*{0.3cm} \begin{tabular}{c|c|c} $q_S(M_{orig})$ & $q_S (M_{scal})$ & steps \\ \hline 1.57e+00 & 1.57e+00 & 1 \\ 1.09e+03 & 6.04e+00 & 3 \\ 1.40e+06 & 8.91e+00 & 7 \\ 2.66e+09 & 9.43e+00 & 8 \\ 1.10e+12 & 1.01e+01 & 13 \\ 1.31e+16 & 9.26e+00 & 13 \\ 1.13e+20 & 1.43e+01 & 16 \\ 1.72e+25 & 1.20e+01 & 17 \\ 2.11e+26 & 1.16e+01 & 18 \end{tabular}} } \end{center} \end{table} Though the direct use of the $QZ$-algorithm is a simple option for computing the eigenvalues of a singular square pencil when the accuracy requirements are moderate, the correct handling of a singular pencil is to first ``deflate'' its left and right null spaces, and then compute the spectrum of the regular part of that singular pencil, i.e., to apply the staircase algorithm (see \cite{Van79}). In this experiment, it turns out that the left and right null spaces are one-dimensional and are given, respectively, by the left null vector of $\left[\begin{smallmatrix} A & B \end{smallmatrix}\right]$, and by the right null vector of $\left[\begin{smallmatrix} A \\ B \end{smallmatrix}\right]$, which we both computed using a singular value decomposition of these compound matrices. \cblu{After this deflation was applied to the original pencil $(\lambda B-A)$, to the pencil $D_\ell(\lambda B-A)D_r$ scaled by the method in Section \ref{sec:regular} and to the one balanced by Ward's method,} we again computed the spectrum of the deflated pencils with the $QZ$-algorithm. The results for the same data as reported in Table \ref{tab:table69-fro} are now reported in Table \ref{tab:table610-fro}. \cblu{The results in this case are similar in both tables. We also added three columns with the sensitivities of the deflation in the original pencil $\gamma_{orig}$ and in the balanced ones by the method in Section \ref{sec:regular} and Ward's method, $\gamma_{bal}$ and $\gamma_{ward}$.} We measured the sensitivity of the left and right null vectors defining the deflation of a singular pencil $\lambda B-A$, by \begin{equation} \label{eq.gammas} \gamma := \max(\frac{\sigma_{n}\left[\begin{smallmatrix} A \\ B \end{smallmatrix}\right]}{ \sigma_{n-1}\left[\begin{smallmatrix} A \\ B \end{smallmatrix}\right]}, \frac{\sigma_{n}\left[\begin{smallmatrix} A & B \end{smallmatrix}\right]}{ \sigma_{n-1}\left[\begin{smallmatrix} A & B \end{smallmatrix}\right]}), \end{equation} i.e. the largest ratio between the two smallest singular values of the matrices that define these null vectors. It is an indication about how much these vectors can rotate when perturbing the pencil. It is easy to see from \cblu{the data that the accuracy of the computed eigenvalues of the deflated pencil is closely related to the sensitivity of the deflation itself.} \begin{table}[h!] \begin{center} \cblu{ \caption{Eigenvalue accuracy of the staircase algorithm for exactly the same singular $500 \times 500$ dense pencils of Table \ref{tab:table69-fro}} \label{tab:table610-fro} {\small \begin{tabular}{c|c|c|c|l|c|c|c} $c_{orig}$ & $c_{bal}$ & $c_{ward}$ & $c_{bal}/c_{orig}$ & $\!c_{bal}/c_{ward}\!$ & $\gamma_{orig}$ & $\gamma_{bal}$ & $\gamma_{ward}$ \\ \hline 2.23e-13 & 2.23e-13 & 2.33e-13 & 1.0e+00 & 9.57e-01 & 5.79e-13 & 5.79e-13 & 6.59e-13 \!\!\\ 4.53e-13 & 4.68e-13 & 2.89e-13 & 1.03e+00 & 1.62e+00 & 1.48e-11 & 4.96e-12 & 7.49e-12 \!\! \\ 6.92e-13 & 9.11e-13 & 2.00e-12 & 1.32e+00 & 4.56e-01 & 2.37e-10 & 2.33e-12 & 1.17e-10 \!\! \\ 8.36e-11 & 1.63e-11 & 9.76e-12 & 1.95e-01 & 1.67e+00 & 1.33e-07 & 5.10e-11 & 4.84e-08 \!\! \\ 6.49e-10 & 1.12e-11 & 8.46e-11 & 1.73e-02 & 1.33e-01 & 1.24e-06 & 2.02e-11 & 1.17e-07 \!\! \\ 1.41e-07 & 5.06e-09 & 2.03e-07 & 3.59e-02 & 2.49e-02 & 1.53e-03 & 2.02e-09 & 1.35e-04 \!\! \\ 7.22e-04 & 1.42e-06 & 1.03e-06 & 1.96e-03 & 1.38e+00 & 9.62e-01 & 3.43e-07 & 1.99e-01 \!\! \\ 3.33e-02 & 1.25e-06 & 9.17e-03 & 3.76e-05 & 1.36e-04 & 2.51e-01 & 2.18e-06 & 5.24e-01 \\ 1.08e-01 & 4.31e-07 & 1.84e-03 & 3.97e-06 & 2.34e-04 & 3.87e-01 & 4.59e-07 & 7.27e-01 \!\! \end{tabular} } } \end{center} \end{table} \cblu{The second family of sparse singular pencils considered in this subsection is a family of $400 \times 400$ permuted block diagonal pencils generated as follows. Set, for simplicity, $m_1 = 140$ and $n_1 = 260$. Then \begin{equation} \label{eq.expersingsquaresparse} \lambda B - A := P \begin{bmatrix} \lambda B_1 - A_1 & \\ & \lambda B_2 - A_2 \end{bmatrix} Q, \end{equation} with $P, Q$ random $400 \times 400$ permutation matrices and \begin{eqnarray*} \lambda B_1 - A_1 & = & T_{\ell 1} \begin{bmatrix} \lambda \Lambda_{B 1} - \Lambda_{A 1} & \\ & 0_{1 \times (n_1 - m_1 +1)} \end{bmatrix} T_{r 1}, \\ \lambda B_2 - A_2 & = & T_{\ell 2} \begin{bmatrix} \lambda \Lambda_{B 2} - \Lambda_{A 2} & \\ & 0_{(n_1 - m_1 +1) \times 1} \end{bmatrix} T_{r 2}, \end{eqnarray*} where $\lambda \Lambda_{B 1} - \Lambda_{A 1}, \lambda \Lambda_{B 2} - \Lambda_{A 2}$ are random $(m_1 - 1) \times (m_1 -1)$ diagonal regular pencils in standard normal form \cite{LemVD} which contain the ``exact'' eigenvalues of $\lambda B - A$, and the entries of $T_{\ell 1} \in \mathbb{R}^{m_1 \times m_1}, T_{r 2} \in \mathbb{R}^{m_1 \times m_1}, T_{\ell 2} \in \mathbb{R}^{n_1 \times n_1}, T_{r 1} \in \mathbb{R}^{n_1 \times n_1}$ are $k$th powers of normally distributed random numbers, for $k = 1 : 5 : 41$. Observe that the normal rank \cite{Van79} of these pencils is $rg = 2(m_1 -1) = 278$, that their left and right rational null spaces are both of dimension $122$ and that their minimal bases are formed by constant vectors. This mean that they are given again, respectively, by the left null vectors of $\left[\begin{smallmatrix} A & B \end{smallmatrix}\right]$, and by the right null vectors of $\left[\begin{smallmatrix} A \\ B \end{smallmatrix}\right]$, which were computed again using a singular value decomposition of these compound matrices. This allowed us to deflate these right and left null spaces and to obtain the regular parts of such pencils by multiplying $\lambda B-A$ on the left by the $rg$ left singular vectors of $\left[\begin{smallmatrix} A & B \end{smallmatrix}\right]$ corresponding to its $rg$ largest singular values and on the right by the $rg$ right singular vectors of $\left[\begin{smallmatrix} A \\ B \end{smallmatrix}\right]$ corresponding to its $rg$ largest singular values. The application of the $QZ$ algorithm to these regular parts yielded the eigenvalues of these highly singular pencils and we did it for the original pencil $(\lambda B-A)$, for the pencil $D_\ell(\lambda B-A)D_r$ scaled by the {\em regularized} method in Section \ref{sec:regularized} and for the one balanced by Ward's method. The plain $QZ$ algorithm can also be applied directly to the pencils in \eqref{eq.expersingsquaresparse}, but it produces much larger errors than the staircase algorithm described above due to the high singularity of these pencils. The results for the staircase algorithm are shown in Table \ref{tab:table611-fro}, where each row corresponds to a value of $k$, and are discussed in the next paragraph.} \begin{table}[h!] \begin{center} \cblu{ \caption{Eigenvalue accuracy of the staircase algorithm for singular $400 \times 400$ sparse pencils: for the original pencil, for the pencil balanced by applying the algorithm in Appendix A with $r=c= (2n) {\mathbf{1}}_{2n}$ and {\tt tol}$=1$ to $M_\alpha^{\circ 2}$ in \eqref{eq:Malpha} with $\alpha = 0.5$, and for the pencil balanced by Ward's method. The improvement in the scaling of $M = |A|^{\circ 2}+|B|^{\circ 2}$ produced by the algorithm in Appendix A applied to $M_\alpha^{\circ 2}$ is also shown in terms of $q_S(M_{orig})$ and $q_S (M_{scal})$, as well as the number of its steps until convergence. The last column of the second table shows that the plain $QZ$-algorithm produces much larger errors for these pencils. For brevity this is only shown for the pencils balanced by the algorithm in Appendix A, but the same happens for the other pencils} \label{tab:table611-fro} {\small \begin{tabular}{c|c|c|c|l|c|c|c} $c_{orig}$ & $c_{bal}$ & $c_{ward}$ & $c_{bal}/c_{orig}$ & $\!c_{bal}/c_{ward}\!$ & $\!\gamma_{orig}\!$ & $\!\gamma_{bal}\!$ & $\!\gamma_{ward}\!$ \\ \hline 1.98e-14 & 2.25e-14 & 2.15e-14 & 1.14e+00 & 1.05e+00 & 1.10e-13 & 1.27e-13 & 9.51e-14 \\ 3.13e-14 & 2.10e-14 & 2.39e-14 & 6.71e-01 & 8.80e-01 & 4.29e-12 & 3.29e-13 & 1.38e-12 \\ 3.40e-12 & 4.49e-14 & 2.72e-13 & 1.32e-02 & 1.65e-01 & 3.80e-10 & 1.28e-12 & 5.64e-11 \\ 1.76e-11 & 4.76e-13 & 2.69e-12 & 2.71e-02 & 1.77e-01 & 3.70e-07 & 5.02e-11 & 1.01e-07 \\ 3.17e-08 & 9.47e-13 & 4.79e-11 & 2.99e-05 & 1.98e-02 & 2.26e-04 & 2.52e-10 & 1.90e-07 \\ 7.84e-03 & 7.43e-11 & 1.10e-08 & 9.48e-09 & 6.74e-03 & 1.0e+00 & 1.20e-09 & 1.11e-03 \\ 2.31e-04 & 1.21e-10 & 5.74e-07 & 5.23e-07 & 2.11e-04 & 1.0e+00 & 5.42e-08 & 1.34e-02 \\ 1.93e-02 & 3.32e-08 & 2.73e-02 & 1.72e-06 & 1.22e-06 & 1.0e+00 & 2.55e-06 & 1.0e+00 \\ 6.46e-01 & 4.64e-10 & 4.19e-03 & 7.17e-10 & 1.11e-07 & 1.0e+00 & 1.21e-07 & 1.0e+00 \end{tabular} \vspace*{0.3cm} \begin{tabular}{c|c|c|c} $q_S(M_{orig})$ & $q_S (M_{scal})$ & steps & $c_{bal}$ plain $QZ$ \\ \hline 3.99e+00 & 9.08e+00 & 16 & 8.56e-07\\ 9.51e+04 & 8.97e+01 & 30 & 8.93e-07\\ 1.75e+09 & 2.85e+03 & 45 & 8.40e-07\\ 5.84e+13 & 1.82e+05 & 66 & 7.01e-07\\ 1.69e+17 & 5.18e+05 & 81 & 2.44e-07 \\ 5.26e+23 & 1.41e+07 & 100 & 2.57e-07 \\ 1.12e+22 & 7.74e+06 & 112 & 9.03e-08 \\ 1.49e+26 & 1.74e+09 & 130 & 5.02e-02 \\ 2.75e+36 & 1.58e+12 & 149 & 5.96e-03 \end{tabular} } } \end{center} \end{table} \cblu{The matrices $M$ corresponding to the pencils in \eqref{eq.expersingsquaresparse} are very far from having total support and the Sinkhorn-Knopp algorithm applied to them with {\tt tol}$= 1$ did not converge because it produced diagonal matrices $D_\ell, D_r$ with zero diagonal entries due to underflows. Then, we regularized the problem by applying the algorithm in Appendix A with $r=c= (2n) {\mathbf{1}}_{2n}$ and {\tt tol}$=1$ to $M_\alpha^{\circ 2}$ in \eqref{eq:Malpha} with $\alpha = 0.5$. Observe, that this yielded factors $q_S (M_{scal})$ very far from $1$ but much smaller than the factors of the original matrices $q_S (M_{orig})$. Interestingly, the factors $q_S (M_{scal})$ did not improve by taking much smaller values of $\alpha$. Despite this fact, the impact of the regularized scaling on the accuracy of the computed eigenvalues is impressive both in comparison with the original pencils and with the pencils scaled by Ward's method. The new regularized method leads to the computation of very accurate eigenvalues in a problem which is extremely difficult in terms of the high singularity and of the high unbalancing of the considered pencils. We do not know any other method in the literature that can achieve such results. Moreover, the numbers of steps until convergence are still moderate taking into account the sparsity and the strong unbalancing of the pencils, and make the cost of the scaling considerably smaller than the cost of computing the eigenvalues. Finally note that Table \ref{tab:table611-fro} also includes the sensitivities of the deflations $\gamma_{orig}$, $\gamma_{bal}$ and $\gamma_{ward}$ as in Table \ref{tab:table610-fro}. They were computed replacing $n-1$ and $n$ in \eqref{eq.gammas} by $rg$ and $rg + 1$, respectively, where $rg = 278$ is the normal rank of the pencils. We also observe in Table \ref{tab:table611-fro} a strong relation between the errors in the eigenvalues and the deflation sensitivities. } \cblu{The experiments in this section show that the balancing procedures of this paper improve the accuracy of the eigenvalue computation of square singular pencils as well as the sensitivity of the deflation of the regular part of a singular pencil}. We briefly mention that recently an alternative robust method to the staircase algorithm has been proposed for computing the eigenvalues of singular pencils \cite{hochstenbach2019}. This new method is related to the ideas in \cite{detedop2010,detedop2008,LotN20} and its accuracy will also improve by using our scaling strategies. \cblu{ \subsection{Examples on the accuracy of computed eigenvalues of rectangular pencils} \label{sub:secrectangularnum} In this section we discuss briefly tests for two families of rectangular pencils that are related to the families in Subsection \ref{sub:3}. The first family includes dense pencils for which the regularization in Section \ref{sec:regularized} is not needed, while the second one corresponds to sparse pencils for which the regularization is necessary. Ward's method is not considered since it does not work for rectangular pencils. All the considered pencils $\lambda B -A$ have the minimal bases of their left and right null spaces formed by constant vectors. Thus, the computation of their eigenvalues is performed via the variant of the staircase algorithm described in the previous subsection, i.e., computing first the regular parts of these pencils with the singular value decompositions of the compound matrices $\left[\begin{smallmatrix} A & B \end{smallmatrix}\right]$ and $\left[\begin{smallmatrix} A \\ B \end{smallmatrix}\right]$, and then applying the $QZ$-algorithm to the regular parts. We use the same notation and test magnitudes as in Subsection \ref{sub:3}.} \cblu{In the first family of tests of this subsection, we generated $150 \times 450$ random pencils of the form $\lambda B- A = T_\ell\diag(\lambda \Lambda_B- \Lambda_A, 0_{1 \times 301})T_r$, where $(\lambda \Lambda_B- \Lambda_A)$ is in standard normal form, has dimension $149 \times 149$ and contains the ``exact'' eigenvalues of $\lambda B- A$. The elements of the random square nonsingular matrices $T_\ell \in \mathbb{R}^{150 \times 150}$ and $T_r \in \mathbb{R}^{450 \times 450}$ are $k$th powers of normally distributed random numbers for $k=1:5:41$. These pencils are dense and then the regularization in Subsection \ref{sec:regularized_rowandcolum} was not needed. The results are shown in Table \ref{tab:table612-fro} (each row corresponds to a value of $k$) and illustrate the very positive effect of the scaling technique of Section \ref{sec:nonsquare} on the accuracy of computed eigenvalues and its low computational cost.} \begin{table}[h!] \begin{center} \cblu{ \caption{Eigenvalue accuracy of the staircase algorithm for rectangular $150 \times 450$ dense pencils: for the original pencil and for the pencil balanced by applying the algorithm in Appendix A with $r=n {\mathbf{1}}_{m}$, $c=m {\mathbf{1}}_{n}$ and {\tt tol}$=1$ to $M = |A|^{\circ 2}+|B|^{\circ 2}$. The improvement in the scaling produced by the algorithm in Appendix A is also shown in terms of $q_S(M_{orig})$ and $q_S (M_{scal})$, as well as the number of its steps until convergence.} \label{tab:table612-fro} {\small \begin{tabular}{c|c|c|c|c|c|c|c} $c_{orig}$ & $c_{bal}$ & $c_{bal}/c_{orig}$ & $\!\gamma_{orig}\!$ & $\!\gamma_{bal}\!$ & $q_S(M_{orig})$ & $q_S (M_{scal})$ & steps \\ \hline 9.96e-15 & 9.96e-15 & 1.00e+00 & 1.01e-13 & 1.01e-13 & 2.29e+00 & 2.29e+00 & 2 \\ 1.95e-14 & 1.08e-14 & 5.52e-01 & 7.97e-13 & 1.97e-13 & 4.94e+03 & 7.77e+00 & 4 \\ 2.62e-13 & 1.06e-14 & 4.03e-02 & 3.03e-10 & 1.57e-13 & 1.22e+08 & 9.66e+00 & 7 \\ 2.27e-12 & 1.29e-14 & 5.68e-03 & 1.31e-08 & 7.73e-13 & 4.32e+11 & 1.06e+01 & 9 \\ 5.61e-09 & 1.97e-13 & 3.52e-05 & 1.39e-04 & 1.72e-11 & 1.36e+16 & 1.17e+01 & 12 \\ 1.51e-05 & 1.20e-13 & 7.97e-09 & 1.95e-01 & 5.78e-12 & 8.19e+23 & 1.07e+01 & 14 \\ 6.03e-05 & 1.08e-12 & 1.79e-08 & 8.08e-03 & 9.12e-12 & 3.51e+22 & 1.27e+01 & 21 \\ 5.49e-02 & 1.72e-11 & 3.13e-10 & 1.00e+00 & 1.36e-09 & 2.39e+29 & 1.17e+01 & 16 \\ 9.76e-02 & 8.40e-12 & 8.60e-11 & 1.00e+00 & 8.24e-10 & 1.24e+31 & 1.32e+01 & 24 \end{tabular} } } \end{center} \end{table} \begin{table}[h!] \begin{center} \cblu{ \caption{Eigenvalue accuracy of the staircase algorithm for singular $700 \times 450$ sparse pencils: for the original pencil and for the pencil balanced by applying the algorithm in Appendix A with $r=c= v$ in \eqref{eq.nonhomogv} and {\tt tol}$=1$ to $M_\alpha^{\circ 2}$ in \eqref{eq:Malpha} with $\alpha = 0.5$. The improvement in the scaling of $M = |A|^{\circ 2}+|B|^{\circ 2}$ produced by the algorithm in Appendix A applied to $M_\alpha^{\circ 2}$ is also shown in terms of $q_S(M_{orig})$ and $q_S (M_{scal})$, as well as the number of its steps until convergence.} \label{tab:table613-fro} {\small \begin{tabular}{c|c|c|c|c|c|c|c} $c_{orig}$ & $c_{bal}$ & $c_{bal}/c_{orig}$ & $\!\gamma_{orig}\!$ & $\!\gamma_{bal}\!$ & $q_S(M_{orig})$ & $q_S (M_{scal})$ & steps \\ \hline 1.43e-14 & 1.26e-14 & 8.86e-01 & 8.91e-14 & 8.70e-14 & 5.54e+01 & 3.27e+01 & 7 \\ 1.73e-14 & 1.39e-14 & 8.06e-01 & 4.05e-12 & 1.25e-13 & 4.64e+06 & 9.30e+03 & 13 \\ 2.81e-13 & 3.75e-14 & 1.34e-01 & 2.74e-10 & 1.30e-12 & 3.10e+11 & 1.80e+06 & 26 \\ 1.77e-11 & 1.98e-14 & 1.12e-03 & 3.28e-08 & 4.72e-12 & 5.14e+19 & 1.42e+10 & 32 \\ 2.42e-06 & 6.23e-14 & 2.58e-08 & 1.81e-03 & 1.27e-11 & 5.87e+28 & 1.09e+13 & 46 \\ 2.42e-02 & 1.15e-10 & 4.77e-09 & 1.00e+00 & 1.85e-08 & 4.53e+29 & 1.11e+18 & 46 \\ 1.69e-04 & 2.24e-11 & 1.32e-07 & 9.84e-01 & 1.07e-07 & 6.95e+37 & 1.42e+20 & 68 \\ 4.10e-03 & 2.83e-11 & 6.88e-09 & 1.00e+00 & 4.18e-06 & 9.32e+39 & 4.30e+22 & 84 \\ 9.91e-01 & 6.07e-11 & 6.13e-11 & 1.00e+00 & 1.03e-07 & 2.72e+44 & 9.90e+22 & 87 \end{tabular} } } \end{center} \end{table} \cblu{For describing the second considered family of sparse rectangular pencils, we need the parameters $m_1 = 100, n_1 = 400, m_2 = 600$ and $n_2 = 50$. Then, the pencils have the structure of those in \eqref{eq.expersingsquaresparse} but with the following changes in $\lambda B_2 - A_2$: the dimension of $\lambda \Lambda_{B2} - \Lambda_{A2}$ becomes $(n_2 -1) \times (n_2 -1)$ and $0_{(n_1 -m_1+1) \times 1}$ is replaced by $0_{(m_2 -n_2+1) \times 1}$. This implies that $T_{\ell 2} \in \mathbb{R}^{m_2 \times m_2}$ and $T_{r 2} \in \mathbb{R}^{n_2 \times n_2}$. For these pencils the algorithm in Appendix A with $r=n {\mathbf{1}}_{m}$, $c=m {\mathbf{1}}_{n}$ and {\tt tol}$=1$ applied to $M$ did not converge and we used the scaling described in Subsection \ref{sec:regularized_rowandcolum} wit $\alpha = 0.5$. The results are shown in Table \ref{tab:table613-fro} (each row corresponds to a value of $k = 1:5:41$) and illustrate again the impressive positive effect of the new scaling technique on the accuracy of computed eigenvalues and its low computational cost. The values of $q_S (M_{scal})$ did not improve by considering very small values of $\alpha$.} \section{Concluding remarks} \label{sec:conclusion} \cblu{In this paper, we developed new scaling techniques that apply to both regular and singular pencils. The techniques are based on applying the Sinkhorn-Knopp-like algorithm to certain nonnegative matrices easily constructed from the matrix coefficients of the pencil, and that depend on whether the scaling problem needs to be regularized or not. The regularization guarantees to get always a unique and bounded solution. Extensive numerical experiments confirm that the proposed techniques very often improve significantly the accuracy of computed eigenvalues of arbitrary pencils and outperform earlier methods for scaling regular pencils. Finally, the algorithms computing these scalings have a computational cost that is much smaller than the cost of the subsequent generalized eigenvalue problem as a consequence of using in the Sinkhorn-Knopp-like algorithm a proper stopping criterion compatible with computing diagonal scalings whose diagonal entries are integer powers of $2$.} \section*{Appendix A : Sinkhorn-Knopp-like algorithm MATLAB code with prescribed row sums and column sums} \label{appendix-A} \begin{verbatim} function [Md,dleft,dright,error] = rowcolsums(M,r,c,maxiter,tol) [m,n]=size(M);error=[]; sumcr=sum(c);sumM=sum(sum(M));Md=M*sumcr/sumM; dleft=ones(m,1)*sqrt(sumcr/sumM);dright=ones(1,n)*sqrt(sumcr/sumM); for i=1:maxiter; dr=sum(Md,1)./c;Md=Md./dr;er=min(dr)/max(dr);dright=dright./dr; dl=sum(Md,2)./r;Md=dl.\Md;el=min(dl)/max(dl);dleft=dleft./dl; error=[error er el];if max([1-er , 1-el]) < tol/2, break; end end scaled=sqrt(max(dright)/max(dleft)); dleft=dleft*scaled;dright=dright'/scaled; end \end{verbatim} \section*{Appendix B : Proof of Lemma \ref{fullyindecomp}} \begin{proof} $M_{\alpha}^{\circ 2}$ has total support for all $\alpha\neq 0$ since every nonzero element is an element of a positive diagonal. To see that $M_{\alpha}^{\circ 2}$ is fully indecomposable, we apply \cite[Theorem 1.3.7]{Brualdi}. This theorem states that a square matrix with total support is fully indecomposable if and only if its bipartite graph is connected. Then we consider the bipartite graph of $M_{\alpha}^{\circ 2},$ denoted by $BG(M_{\alpha}^{\circ 2}).$ We assume without lost of generality that $m_{1n}$ is a nonzero element of $M:=[m_{ij}].$ Then we consider the matrix $$N:=\left[\begin{array}{c|c} \frac{\alpha^2}{m^2} 1_m 1_m^{T} & \begin{array}{cc} 0 & m_{1n} \\ 0 & 0 \end{array} \\ \hline \begin{array}{cc} 0 & 0\\ m_{1n} & 0 \end{array} & \frac{\alpha^2}{n^2} 1_n 1_n^{T} \end{array}\right].$$ Notice that $BG(N)$ is a sub-graph of $BG(M_{\alpha}^{\circ 2}).$ Moreover, if $\{u_1,u_2,\ldots,u_{m+n}\} $ and $\{v_1,v_2,\ldots,v_{m+n}\} $ are the sets of vertices associated with the rows and columns of $N,$ respectively, then $ BG(N)$ is of the form \begin{center} \includegraphics[scale=0.5]{bipartitegraph} \end{center} where the left and right groups of solid edges are each bicliques (and hence connected) and where the two dashed edges correspond to the element $m_{1n}.$ This proves that $ BG(N)$ is connected, since the dashed edges make a connection between two connected components. Therefore, $BG(M_{\alpha}^{\circ 2})$ is connected and, by \cite[Theorem 1.3.7]{Brualdi}, $M_{\alpha}^{\circ 2}$ is fully indecomposable. \end{proof} \vspace*{0.25cm} \noindent \cblu{{\bf Acknowledgements.} The authors sincerely thank two anonymous referees for pointing out several significant suggestions and a number of relevant references that have contributed to improve this manuscript.} \vspace*{0.25cm}
{ "redpajama_set_name": "RedPajamaArXiv" }
8,168
Sauriurae is een oude naam voor een basale tak van de klasse van de vogels. In 1866 stelde Ernst Haeckel de, foutgespelde, naam "Saururae" voor om Archaeopteryx een plaats te geven. "Sauriurae" betekent "Reptielstaarten" en deze stelde Haeckel dan tegenover alle andere toen bekende vogels: de Ornithurae, de "Vogelstaarten". In 1983 stelde Martin voor de naam te gebruiken voor de groep die zowel de Archaeornithes waaronder Archaeopteryx omvatte als de Enantiornithes. Zo'n groep zou echter parafyletisch zijn omdat de Enantiornithes nauwer verwant zijn aan de Neornithes dan aan Archaeopteryx. Dergelijke groepen worden in de moderne paleontologie algemeen verworpen. Een kladistische definitie van de naam is nooit gegeven. Het concept wordt tegenwoordig alleen toegepast door de BAND, de kleine groep die niet gelooft dat vogels dinosauriërs zijn, in een vage en veranderlijke betekenis, en verder komt het woord nog wel voor in populair-wetenschappelijke boeken die zich op verouderde naslagwerken baseren. Uitgestorven vogels Vogels
{ "redpajama_set_name": "RedPajamaWikipedia" }
7,580
{"url":"https:\/\/codegolf.stackexchange.com\/questions\/15668\/find-the-absolute-value-of-a-number-without-built-in-functions?page=2&tab=votes","text":"# Find the absolute value of a number without built-in functions [closed]\n\nThe challenge is to take any real number as input and output or return the absolute value. You may not use any built-in functions other than those dealing with input and output\/returning. This is code golf, so the shortest code wins. This is my first question here, so bear with me if I've left something obvious out of the challenge.\n\nAs per Quincunx's suggestion, I am limiting input to anywhere between -9E99 and 9E99.\n\nAlso, the only functions\/operators you can use are input, output, return, +, -, *, \/, %, ^ +=, -=, *=, \/=, >, <, ==, >=, <=, !=, square, and square root or their equivalents\n\n\u2022 @Timtech: Can you clarify \"You may not use any built-in functions\"? For example, does the GolfScript answer violate this rule when it uses the built-in split functions? Or did you just mean built-in functions that are specifically designed to calculate the absolute value? \u2013\u00a0musefan Dec 9 '13 at 14:08\n\u2022 @musefan You may not use any built in functions (math operators are not included, they are not functions). The GolfScript answer did violate the rule; that's why it's not accepted. \u2013\u00a0Timtech Dec 9 '13 at 15:50\n\u2022 @tim Why don't operators count as functions? In C and friends you can override operators and use them just like normal functions. This seems to be a very vague rule \u2013\u00a0Doorknob Dec 9 '13 at 17:57\n\u2022 -1. Question is vague and the definition of \"built-in function\" has only appeared in the comments 3 days after the question was posed. It seems like you're just looking for the shortest way to say printf(x*(x<0?-1:1)) in a number of languages. \u2013\u00a0Gareth Dec 11 '13 at 20:15\n\u2022 Apart from the fact that the question as currently written seems to permit a whitelist of operators but only if they're not built in to the language, this is a classic example of why trying to whitelist permitted operations is a disaster. Consider >: in some languages it returns 0 or 1; in other languages it returns true or false and Booleans can't be cast to integers. Should languages in the second category be permitted to use ?: in contexts which could be algebraically rewritten in terms of the condition as 0 or 1 under the \"or their equivalents\" grant? It's extremely fuzzy \u2013\u00a0Peter Taylor Dec 14 '15 at 11:34\n\n# Swift, 35 bytes (Not Competitive)\n\nThis is just for fun, and because Swift was developed after this question was posted, is not a competitive answer.\n\nfunc a(v:Int)->Int{return v<0?-v:v}\n\n\nun-golfed version\n\nfunc absolute(value: Int) -> Int{\nreturn value < 0 ? -value : value\n}\n\n\u2022 It is important to note that the language was invented after the challenge and therefore it technically is not a competitive answer. \u2013\u00a0TanMath Dec 2 '15 at 5:55\n\n## PowerShell: 38\n\nLazy if\/else. Maybe I'll find a shorter way later.\n\nif(($x=+(read-host))-lt0){-$x}else{$x} # R 17 characters max(n<-scan(),-n) Or 13 characters by adapting David Carraher Mathematica answer: sqrt(scan()^2) \u2022 Max isn't allowed; I'd recommend switching to your 13 character solution. \u2013 Timtech Dec 24 '13 at 14:45 ## Ti-84 Table, 12 5 characters The text in brackets are the square root character and the squared character, respectively. Y=[square root]X[^2] The old code: Y=X(2(X>0)-1 Both of these handle rational and irrational numbers. Any real number is valid, with limits of -9.99999999*10^99 and 9.99999999*10^99 for the second one and sqrt(-9.99999999*10^99) and sqrt(9.99999999*10^99) for the first one. Gets input on X and shows equivalent absolute number as Y. \u2022 Square root is a function. \u2013 Gareth Dec 11 '13 at 20:19 \u2022 @Gareth It's dealing with mathematics. \u2013 Timtech Dec 11 '13 at 21:38 ## PowerShell, 22 (read-host)-replace'-' Or, if the returned value has to typed as numeric, 23: +(read-host)-replace'-' ## F#, 30 let a x=if x<0. then -x else x # Python (20) lambda x:x*2*(x>0)-x # Python - 27 chars >>> f=lambda x:-x if x<0 else x >>> f(-19.768) 19.768 \u2022 -1. This does not comply with the specs. It does not return the absolute value, it simply negates the input (try f(300)). Fix it and I'll revert the vote. \u2013 Justin Dec 14 '13 at 3:24 \u2022 oh duhh... fixed it \u2013 KGo Dec 14 '13 at 3:35 AWK, 15 1,$0*=$1<0?-1:1 Note that, the following code can handle all values except 0 AWK, 13 $0*=$1<0?-1:1 No one use sed? similar as perl s\/-\/\/ ## PHP, 40 <?$n=$argv[1];if($n<0) $n*=-1;echo$n;\n\n\n# SQL - 43 chars\n\nSELECT CASE WHEN @n<0 THEN -@n ELSE @n END;\n\n\u2022 Which SQL dialect? MSSQL lets you skip some spaces and the semicolon (40 chars): select case when @n<0then-@n else @n end, MySQL handles boolean (22 chars): select((@n>0)*2-1)*@n;. \u2013\u00a0manatwork Jan 7 '14 at 18:41\n\u2022 @manatwork, I was aiming for a DBMS agnostic answer. In MySQL, this would save 1 more char: SELECT(@n>0)*2*@n-@n; And the semicolon is not strictly needed in any dialect. \u2013\u00a0ypercube\u1d40\u1d39 Jan 7 '14 at 21:36\n\n# Arcy\u00f3u, 16 bytes\n\n(F(x)(^(^ x 2).5\n\n\nThis is an anonymous function taking one numeric type. It returns a floating point number equal to the number's absolute value. This is just nested exponentiation.\n\n## FP15 (7)\n\n(*)sqrt\n\n\nThe (*) function squares a number. How does it work? In Haskell, (2*) means \\x -> 2 * x and (*2) is \\x -> x * 2, but (*) isn't \\x -> x * x. In FP15, you can do (*) and even things like (*2+1) and (^2 - 5*sqrt). Also, in FP15, function composition is left-to-right.\n\nExamples (~ is negation):\n\n$.\/fp15-repl.py > 12(*)sqrt 12.0 > 0(*)sqrt 0.0 > ~12(*)sqrt 12.0 If the signum function is allowed: (*sgn) If conditionals are allowed: {(<0):~|_} If max is allowed: (~.max) [,~]max I created this language and it's still work in progress (no IO functions for now), but the last time I worked on it was early October. # Go, 62 bytes Pretty straightforward, I should think. Submitting a noncompilable standalone function feels so... wrong. func a(){a:=\"\" Scanln(&a) b,_:=Atoi(a) if b<0{b=0-b} Print(b)} # Rotor, 2 bytes sS Challenge predates this language by two years, so this isn't competitive. Squares input and then square roots it. Nothing special. Note: this answer was written before the rule change mess, and was valid at time of posting. # Mouse-2002, 11 bytes The DUP word is two bytes too long, and it requires a space after it. :( However, it still costs less than a var. (2 bytes per use) ?&DUP 0<[_] Expanded: ? ~ input &DUP ~ dup 0 < ~ cmp [ ~ if _ ~ signflip ] ~ fi Or, if leaving the value on the stack is not sufficient, then 12 bytes: ?&DUP 0<[_]! This language needs implicit printing if nothing was. $ mouse abs.mou\n-100e99\n100e99\n$mouse abs.mou -INF INF$\n\n\nDo I get a bonus if my program can compute every real number?\n\n# LISP, 38\n\n(define (abs x)\n(cond ((< x 0) (- x))\n(else x)\n))\n\n\u2022 Please add also the character count. \u2013\u00a0ProgramFOX Dec 27 '13 at 9:14\n\n## Ti-Basic 84, 10 bytes\n\nAns(2(Ans>0)-1\n\n\u2022 Do you not need to close the outer parenthesis? \u2013\u00a0Peter Taylor Dec 6 '13 at 23:26\n\u2022 @PeterTaylor No, it is not required. \u2013\u00a0Timtech Dec 6 '13 at 23:30\n\u2022 This doesn't work. \u2013\u00a0lirtosiast Dec 1 '15 at 17:19\n\u2022 Fixed! Input & output on Ans which is the standard \u2013\u00a0Timtech Jan 22 '16 at 13:30\n\u2022 I won't remove my downvote, because this is essentially your third redundant TI-BASIC answer. \u2013\u00a0lirtosiast Jan 22 '16 at 16:40","date":"2020-12-05 02:59:25","metadata":"{\"extraction_info\": {\"found_math\": true, \"script_math_tex\": 0, \"script_math_asciimath\": 0, \"math_annotations\": 0, \"math_alttext\": 0, \"mathml\": 0, \"mathjax_tag\": 0, \"mathjax_inline_tex\": 1, \"mathjax_display_tex\": 0, \"mathjax_asciimath\": 1, \"img_math\": 0, \"codecogs_latex\": 0, \"wp_latex\": 0, \"mimetex.cgi\": 0, \"\/images\/math\/codecogs\": 0, \"mathtex.cgi\": 0, \"katex\": 0, \"math-container\": 0, \"wp-katex-eq\": 0, \"align\": 0, \"equation\": 0, \"x-ck12\": 0, \"texerror\": 0, \"math_score\": 0.22053886950016022, \"perplexity\": 2463.3187104210215}, \"config\": {\"markdown_headings\": true, \"markdown_code\": true, \"boilerplate_config\": {\"ratio_threshold\": 0.18, \"absolute_threshold\": 10, \"end_threshold\": 15, \"enable\": true}, \"remove_buttons\": true, \"remove_image_figures\": true, \"remove_link_clusters\": true, \"table_config\": {\"min_rows\": 2, \"min_cols\": 3, \"format\": \"plain\"}, \"remove_chinese\": true, \"remove_edit_buttons\": true, \"extract_latex\": true}, \"warc_path\": \"s3:\/\/commoncrawl\/crawl-data\/CC-MAIN-2020-50\/segments\/1606141746033.87\/warc\/CC-MAIN-20201205013617-20201205043617-00198.warc.gz\"}"}
null
null
Q: PHP MySQL can't find my image from Database Im working on a blog site for school where i have to make a posting system with PHP MySQL. I'm now trying to add images to my post, I've already made a image uploader and its completly working. Now i want to make an option button to choose which image i want at a specific blog post, so i tried to make an option button which would show me all the image names i had in my Database, but now it doesnt say anything and the code stops working after my php code in my form. It shows the Title, body and category but then shows an empty option box. The submit button is not showing aswell. I hope someone could help me out with this problem im having! I cant post images yet so i'll tell what my DB names are, image_id //id of the image name //name of the image image //blob I've also put the image_id in my 'post' table. Code: <?php session_start(); if(!isset($_SESSION['user_id'])){ header('Location: login.php'); exit(); } include('../includes/db_connection.php'); if(!isset($_SESSION['user_id'])){ header('Location: login.php'); exit(); } if(isset($_POST['submit'])){ //get the blog data $title = $_POST['title']; $body = $_POST['body']; $category = $_POST['category']; $image = $_POST['name']; //link everything to the db $title = $db->real_escape_string($title); $body = $db->real_escape_string($body); $user_id = $_SESSION['user_id']; $date = date('Y-m-d G:i:s'); $body = htmlentities($body); //check if all of these are there if($title && $body && $category && $image){ //place data back into the database $query = $db->query("INSERT INTO posts (user_id, title, body, category_id, image_id, posted) VALUES('$user_id', '$title', '$body', '$category', '$image', '$date')"); if($query){ echo "post added"; } else{ echo "error"; } } else{ echo "MISSING DATA"; } } ?> <!DOCTYPE html> <html> <head> <meta charset="utf-8"/> <meta http-equiv="X-UA-Compatible" content="IE=9"/> <title> Portfolio Sander Mateijsen </title> <style> #wrapper{ margin: auto; width: 800px; } label(display:block) </style> </head> <body> <div id="wrapper"> <div id="content"> <form action="<?php echo $_SERVER["PHP_SELF"]?>" method="post"> <label>Titel:</label><br><input type="text" name="title" /><br> <label for="body"> Body:</label><br> <textarea name="body" cols=50 rows=10></textarea><br> <label> Category:</label><br> <select name="category"> <?php //display categories from the database as options $query = $db->query("SELECT * FROM categories"); while($row = $query->fetch_object()){ echo "<option value='".$row->category_id."'>".$row->category."</option>"; } ?> </select> <label> Image:</label><br> <select name="name"> <?php //display images from the database as options $query = $db->query("SELECT * FROM blob"); while($row = $query->fetch_object()){ echo "<option value='".$row->image_id."'>".$row->name."</option>"; } ?> </select> <br><br> <input type="submit" name="submit" value="submit" /> </form> <a href="overzicht_post.php"> Terug naar overzicht.</a> </div> </div> </div> </body> </html> A: if($title && $body && $category && $image){} checking boolean values on your code. Change this line to if(isset($title) && isset($body) && isset($category) && isset($image)){} Also $query = $db->query("INSERT INTO posts (user_id, title, body, category_id, image_id, posted) VALUES('$user_id', '$title', '$body', '$category', '$image', '$date')"); is wrong, use prepare and execute methods for insert and update and bind values $query = $db->prepare("INSERT INTO posts (user_id, title, body, category_id, image_id, posted) VALUES(:user_id, :title, :body, :category, :image, :date)"); $query->bindParam(":user_id",$user_id); $query->bindParam(":title",$title); $query->bindParam(":body",$body); $query->bindParam(":category",$category); $query->bindParam(":image",$image); $query->bindParam(":mydate",$date); //dont use date as bindparam because it is a special name. $query->execute(); Also you're not passing posted. I assumed you have default value on your sql column for this field.
{ "redpajama_set_name": "RedPajamaStackExchange" }
2,886
Kilen produce the widest range of OE replacement coil springs in the UK, all available from stock. Constant range expansion means we can offer the most comprehensive vehicle parc coverage, as reflected in our range of catalogues featuring over 650 new coil springs and over 350 new gas springs, all carefully selected from the most up-to-date UK car parc information. Every Kilen spring is subjected to the most stringent product quality tests, so quality is always assured. hi jim ,,tryin to contact kilen direct ,,,,been on net cant find website???
{ "redpajama_set_name": "RedPajamaC4" }
6,414
View 3104 Summerhouse Dr Brand new home in The Riverfront features 5 bedrooms, 3.5 baths, finished room over garage could be 5th bedroom. Covered back porch and patio overlooks beautiful lake. 1st floor bedroom and bath. Optional membership is available to the Riverfront Swim Club (two pools, clubhouse, monthly activities).
{ "redpajama_set_name": "RedPajamaC4" }
4,902
Hippidion principale és una espècie de mamífers extints de la família dels èquids. Visqueren a Sud-amèrica (Argentina, Bolívia, Brasil, el Perú, Uruguai i Xile) durant el Plistocè. Referències Equins Èquids extints Perissodàctils del Plistocè
{ "redpajama_set_name": "RedPajamaWikipedia" }
5,970
RStudio v0.94 is now(20110615) available. In this release we've made lots of enhancements based on the feedback we've received over the past few months. Highlights include new editor features like automatic indentation, brace matching, and function navigation as well as significantly improved plot exporting, package installation, and history management. Full details on everything included in the release can be found here: v0.94 release notes. This entry was posted in 生物统计, 所有博文 and tagged GUI, IDE, R, 更新, 软件 by Yixf. Bookmark the permalink.
{ "redpajama_set_name": "RedPajamaC4" }
5,727
Ryan Gosling To Direct Matt Smith In Dark Fantasy Film This is a bit of interesting news. Apparently, actor Ryan Gosling (The Notebook, Half Nelson, Drive, Gangster Squad) will be making his directorial debut in a new film entitled, How to Catch a Monster. The film's website states: Written and directed by Ryan Gosling, HOW TO CATCH A MONSTER weaves elements of fantasy noir, horror and suspense into a modern day fairytale. Set against the surreal dreamscape of a vanishing city, Billy, a single mother of two, is swept into a macabre and dark fantasy underworld while Bones, her 18-yr-old son, discovers a secret road leading to an underwater town. Both Billy and Bones must dive deep into the mystery, if their family is to survive. First of all, the fact that Ryan Gosling has written and will be directing this film is exciting in and of itself; but there are also a couple of interesting casting choices that might make this movie something very special. Christina Hendricks (Mad Men, Firefly) will be starring as Billy, while Gosling's off-screen girlfriend, Eva Mendes (Hitch, Ghost Rider) has an undisclosed starring role as well. Finally, an announcement has been made today of one more starring role which has yet to be fully disclosed: Matt Smith! That's right, the current Doctor from the long running BBC science fiction television show, Doctor Who, will be making his film debut. Does the director/actor/story combination sound intriguing enough to warrant interest in this project? What are your thoughts? Categories: Fantasy, Horror, Movies, # Christina Hendricks #Doctor Who #Eva Mendes #Firefly #Gangster Squad #Ghost Rider #Half Nelson #Hitch #How to Catch a Monster #Mad Men #matt smith #Ryan Gosling #The Notebook ← Being Human UK To End After 5th Series 4 comments on "Ryan Gosling To Direct Matt Smith In Dark Fantasy Film" sarah Feb 7, 2013 Yeah, I'm definitely going to see that. Prediction: Ryan and Matt will become BFFs through this experience. max Feb 7, 2013 Yeah, it sounds awesome…and you're probably right. alyssaz Feb 7, 2013 Sounds strange, to say the least. But I will be in line to check it out! saucha Feb 15, 2014 If it has Matt Smith in it then I'm definitely watching it!
{ "redpajama_set_name": "RedPajamaCommonCrawl" }
31
Before the opening of the museum on June 2, 1984, extensive restoration and rehabilitation began on the historic Everett Building to transform it into the Gregg County Historical Museum. The San Antonio architectural firm of De Lara-Almond Architects Inc. was retained, and Killis P. Almond, Jr., AIA, was the project architect. The general contractor was David Stewart Construction Company of Longview. The result of their expertise and many months of labor was a resounding success. Charles A. Paramore of Museum Arts in Dallas designed and installed the exhibit areas to illustrate the development of Gregg County with antiques and historic photographs in themed settings. Mr. Paramore arranged the entire space, as well as each display. On the main floor, he took a rectangular room and made it magical with a variety of exhibit layouts and traffic flow features. On February 20, 1983, friends and supporters of the museum were invited to attend the dedication of the rehabilitated Everett Building. In the same year, the building was recorded as a Texas Historic Landmark. After 74 years, the graceful old edifice became the home of Gregg County Historical Museum, which was officially opened to the public on June 2, 1984. The structure of the building is the most valuable artifact at the museum. In our community, where has very few buildings that were built before 1930 survive, the Everett Building is extremely important. The museum's beautiful lobby has the original inlaid tile floor and pressed tin ceiling with cherubs. Many children have been quoted as saying that the ceiling looks like icing on a beautiful cake. The museum celebrated its 25th anniversary in 2009. During the first 25 years, it has hosted visitors from all 50 states and over 36 foreign countries. Going forward our exhibits, services and educational programs continue to expand. Gregg County Historical Museum is a precious gem in the heart of downtown Longview. The institution and the people who are committed to its continued success have become woven into the fabric of the community.
{ "redpajama_set_name": "RedPajamaC4" }
8,773
{"url":"https:\/\/cran.rstudio.com\/web\/packages\/RndTexExams\/vignettes\/rte-vignette_creating_exams.html","text":"# Introduction\n\nThe package RndTexExams creates exams with randomized content using R and latex. The R code will take as input a latex file and randomly define, for all of the multiple choice questions, the order of the questions and the order of the answers. The user can also change the content of the questions in each version.\n\nThe main target audience of this code is composed of examiners that are considering minimizing cheating in their exams. Based on this package and a database of questions, one can build an unique test and answer sheet for each student in the class, therefore making it nearly impossible to cheat by looking around or sharing the answer sheet. The use of the package with a cloud based spreadsheet tool also makes it possible to grade the exams digitally, without any manual intervention. This is a great feature that minimizes grading work in large classes. If you are still not convinced that the student might be cheating, you can statistically test this hypothesis using RndTexExams (see the other vignette).\n\nThe code of RndTexExams is built around the stable framework of examdesign and exam. Users that are not familiar with LaTeX and its exam classes, I strongly advice to read the manuals before using RndTexExams. Users familiar with both can start using RndTexExams with minor additions to the Latex file.\n\n# How to use RndTexExams\n\n## Before you start\n\nIn order to use RndTexExams you will need to install latex. You have two main choices, miktex and texlive. I also advice to use a nice IDE such as texstudio.\n\nMiktex and texlive are good choices and should work well with RndTexExams. My advice for those first starting out in latex is to download the example file of the package from here and compile it using your flavor of latex.\n\nFor Linux users it might be necessary to install the latex packages examdesign and exam and the system function texi2dvi. The following terminal code will make sure all latex requirements are installed and ready for use:\n\nsudo apt-get install texlive-base texlive-latex-extra texinfo\n\n## How to write questions with examdesign and RndTexExams\n\nA standard multiple choice exam is compose of several questions that have a main text and a set of alternative answers to choose from. A simple example is:\n\nGiven the next five options, which one is the correct answer?\n\na) Choice 1\n\nb) Choice 2\n\nc) Choice 3\n\nd) Choice 4\n\ne) Choice 5 - The CORRECT answer!\n\nFor the rest of this tutorial we will use the examdesign template as it is well structured and self contained class for exam. The package RndTexExams also works for the exam class. In examdesign, the structure of a multiple choice question is defined using latex commands. The start of the multiple answer section is encapsulated by commands \\begin{multiplechoice} and \\end{multiplechoice}. Within this environment, all questions begin with \\begin{question} and end with \\end{question}. The multiple answers of the questions are marked as \\choice{}.\n\nNext I show the latex code that results in the previous example:\n\n% Example of a multiple choice question in examdesign (only one version)\n% The preamble and the rest of the document are ommited for simplification.\n% Be aware that this simple code as it is will NOT compile in pdflatex as it needs other requirements\n\n\\begin{multiplechoice}\n\n\\begin{question}\n\nGiven the next five options, which one is the correct answer?\n\n\\choice{Choice 1}\n\\choice{Choice 2}\n\\choice{Choice 3}\n\\choice{Choice 4}\n\\choice[!]{Choice 5 - The CORRECT answer!}\n\n\\end{question}\n\n\\end{multiplechoice}\n\nNotice from this simple example that each question has a main text and choices. The right answer of the question is marked with the symbol [!] as in \\choice[!]{text of answer here}. The right answer for each question can be later used to build a version of the test with the correct answers for all questions.\n\nThe package RndTexExams will read the latex file, search for all occurrences of a multiple choice question then randomly rearrange the order of questions and alternatives, building a new latex file for each of the version of the exam. Therefore, each version of the test will have a different answer sheet. The latex files are later compiled from R, resulting in a set of pdf files that are ready for printing.\n\n### Changing the textual content of the exam\n\nThe package RndTexExams can use textual switches with specific symbols in order to define parts of the questions that can change in between versions. This is an optional feature for those examiners that wish to create different versions of the same questions.\n\nAny change in the text, whether it is in the main text of the question or text of the answers, is marked with symbol @{text in ver 1}|{text in ver 2}|{text in ver 3}@. Making it clear, each version of the test will show the text according to its position. So, in version one it will show the text text in ver 1, in version two it will show the text text in ver 2 and so on. The version of the content changes every time that R and Latex compiles a new test.\n\nSince we are changing the text of the questions and answers, it is also necessary to change the correct answers in each version. To do this, simply add the symbol [x] in the text of the answers, where x is the version in which the alternative is correct.\n\nAs an example, we can make different versions of the previous example question by using the following latex code with RndTexExams:\n\n% Example of multiple choice question in examdesign, with 2 versions\n\\begin{multiplechoice}[resetcounter=no, examcolumns=1]\n\n\\begin{question}\n\nGiven the next five options, which one is the correct answer in @{version 1}|{version 2}@?\n\n\\choice{Choice 1 - Incorrect in all versions}\n\\choice{[2] Choice 2 - @{Incorrect in version 1}|{Correct in versin 2}@ }\n\\choice{Choice 3 - Incorrect in all versions}\n\\choice{Choice 4 - Incorrect in all versions}\n\\choice{[1] Choice 5 - @{Correct in version 1}|{Incorrect in version 2}@ }\n\n\\end{question}\n\n\\end{multiplechoice}\n\nAnd that\u2019s it! The R code in RndTexExam will look for these symbolic expressions and randomly choose one of them for the final version of each exam.\n\nOnce you have your questions with the proper syntax for using with RndTexExams, all you need to do is to pass the tex file to functions rte.analyze.tex.file and later to rte.build.rdn.test. Next, I present the use of RndTexExam with an example latex file from the package.\n\nlibrary(RndTexExams, quietly = TRUE)\n## Package 'sm', version 2.2-5.4: type help(sm) for summary information\n##\n## Attaching package: 'MASS'\n## The following object is masked from 'package:sm':\n##\n## muscle\nset.seed(10)\n\n# Get latex file from package\nf.in <- system.file(\"extdata\", \"MyRandomTest_examdesign.tex\", package = \"RndTexExams\")\n\n# Breakdown latex file into a a list\nlist.out <- rte.analyze.tex.file(f.in,\nlatex.dir.out = 'latexOut',\npdf.dir.out = 'PdfOut') \n##\n## rte: Changing LaTeX file into dataframe... Done\n# Options for build.rdn.test\nlist.in <- list.out # output from rte.analyze.tex.file\nf.out <- 'MyRandomTest_' # pattern for names of pdfs\nn.test <- 10 # number of random tests (usually the number of students)\nn.question <- 4 # number of questions in each test\npdf.dir.out <- 'PdfOut' # directory for pdf output\n\n# Builds pdfs\nlist.build.rdn.exam <- rte.build.rdn.test(list.in = list.in,\nf.out = f.out,\nn.test = n.test,\nn.question = n.question,\npdf.dir.out = pdf.dir.out) \n##\n## rte: Checking for error in inputs... Done\n## rte: pdflatex flavor: texlive\n## rte: Type of OS: Linux\n## rte: Latex compile function: custom\n## rte: Type of exam template: examdesign\n## rte: Number of mchoice questions: 4\n## rte: Building Test #1...Done\n## rte: Building Test #2...Done\n## rte: Building Test #3...Done\n## rte: Building Test #4...Done\n## rte: Building Test #5...Done\n## rte: Building Test #6...Done\n## rte: Building Test #7...Done\n## rte: Building Test #8...Done\n## rte: Building Test #9...Done\n## rte: Building Test #10...Done\n## rte: FINISHED - Check folder PdfOut for pdf files\n\nThe function rte.analyze.tex.file will analyze the tex file and produce a R list with all of the details of the latex code. It will find and separate all of the multiple choice questions. I encourage the user to open the resulting list to see how all of the latex code is broken down into pieces.\n\nThe function rte.build.rdn.test will use the output from rte.analyze.tex.file, randomize all of the contents of the multiple choice questions and later paste together a new latex file used to compile the pdf files of the exam.\n\nThe correct answer sheet for all versions is available in list.build.rdn.exam$df.answer.wide, where each row is the version of the test and the columns are the answers. The list output from rte.build.rdn.test should be locally saved as a .RDATA file with command save in order to be used later in the grading process. I also advice to use function set.seed() so that every run of the code always results in the same random answer sheet. Next I show the answer matrix of the exam, where each column is a question and each row is a version of the exam. print(list.build.rdn.exam$answer.matrix)\n## 1 2 3 4\n## Version 1 \"a\" \"e\" \"a\" \"d\"\n## Version 2 \"b\" \"e\" \"c\" \"a\"\n## Version 3 \"a\" \"d\" \"e\" \"a\"\n## Version 4 \"e\" \"c\" \"a\" \"a\"\n## Version 5 \"c\" \"b\" \"e\" \"a\"\n## Version 6 \"b\" \"b\" \"a\" \"c\"\n## Version 7 \"e\" \"c\" \"b\" \"b\"\n## Version 8 \"e\" \"a\" \"e\" \"b\"\n## Version 9 \"d\" \"c\" \"e\" \"e\"\n## Version 10 \"c\" \"e\" \"d\" \"c\"\n\nThe package RndTexExams also makes it easy to grade exams using R. This is specially helpful when integrating the submission of the student\u2019s answers with a cloud based spreadsheet service that allows the examiner to record and process the answers of each student efficiently (details later).\n\nWhen examining a class with RndTexExam, one should have the following information from the students:\n\n\u2022 Names or ids of students in the test\n\u2022 The version of the exam for each student. By default, the version of the exam is printed in right bottom corner of the pdf\n\u2022 The answers for each student (Q1 = \u2018a\u2019, Q2=\u2018b\u2019, \u2026)\n\u2022 The grading score of each question (optional)\n\nThe workflow of grading begins by pairing each student\u2019s name with a version of the exam. After that, grading the exam is accomplished by summing the number of correct answers weighted by the grading score of each question. The function rte.grade.exams will perform this calculation.\n\nIn the next example I show the use of function rte.grade.exams with some random data.\n\nset.seed(10)\n\n# create some (almost) random names\nmy.names <- c('John', 'Max','Michael','Marcelo','Ricardo', 'Tarcizio')\n\n# random version of the test for each student\nver.test <- sample(n.test,size = length(my.names),replace = TRUE)\n\n# number of simulated questions (same as before)\nn.questions <- 4\n\n# Get the correct answer sheet from previous code\ncorrect.answer.sheet <- list.build.rdn.exam$answer.matrix # create simulated answers from students (cheat a little bit!) q.to.cheat <- floor(n.questions\/2) # get at least half of questions right! my.answers <- cbind(correct.answer.sheet[ver.test,1:q.to.cheat], matrix(sample(letters[1:5], replace = T, size = length(my.names)*(n.questions-q.to.cheat)), ncol = n.questions-q.to.cheat )) # grade exams with rte.grade.exams grade.l.out <- rte.grade.exams(exam.names = my.names, exam.version = ver.test, exam.answer.matrix = my.answers, list.build.rdn.exam = list.build.rdn.exam) Now we can plot the results of the grading process. # print results in a bar plot library(ggplot2) p <- ggplot(grade.l.out$df.final.score, aes(y = final.score, x = my.names))\np <- p + geom_bar(stat = \"identity\") + labs(title = 'Final Score')\np <- p + theme(axis.text.x = element_text(angle = 90, hjust = 1))\nprint(p)\n\np <- ggplot(grade.l.out\\$df.grade, aes(y = n.question, x = exam.names, fill = grade.logical))\np <- p + theme(axis.text.x = element_text(angle = 90, hjust = 1))\nprint(p)\n\nThe use of RndTexExam is optimized when using a cloud based spreadsheet tool to register the answers for the students. This avoid the manual work usually needed to process the information from the application of the exam. The package RndTexExam not only minimizes cheating but can also make the grading process painless.\n\nThe cloud services I currently use and recommend is Google Spreadsheets and Google Forms. Both are free and easy to use. Next I present the steps I suggest in order to build a random exam and grade it using a spreadsheet in the cloud.\n\n1. Create a randomized exam with rte.build.rdn.test. Make sure you locally save the correct answer sheet for each version of the test (output answer.matrix). I also advice to use set.seed() in order to keep the same randomized content of the tests, just in case.\n2. Create a new form in Google Forms with the following questions (example here:\n\u2022 Name of Student (short answer)\n\u2022 ID Card (optional) (short answer)\n\u2022 Version of test (short answer with numerical validation)\n\u2022 Answers of the test (Multiple choice grid, row = Question number, col = alternatives (a,b,c,d,e))\n1. In the day of the test, deliver the printed exams from step 1 and inform the students of the link previously created in Google forms, step 2. The site tinyurl will help to create a customized human-readable link. I usually write the link in the blackboard so that only those that came to the exam can access it. Once the student finishes the exam, he\/she can register their answers with their smartphones by accessing the link in a browser. I also bring a laptop with internet connection just in case that some students don\u2019t have a smartphone. As a backup plan, make sure all students return the printed exams.\n\n2. Once all students have registered their answers, gain access to the spreadsheet in the cloud with package googlesheets. This way you can easily import the data from the cloud into R. I also advice to run a code to check the data in the cloud. Make sure that each student only has one registration and that the version of the test is unique for each. The link to the example spreadsheet previously created is here. See the vignette of googlesheets here for examples of how to get access of a Google spreadsheet.\n\n3. Use the information from the cloud and the correct answer sheet from step 1 with rte.grade.exams in order to grade the exams and calculate the final score for each.\n\n# Getting started on your own test\n\nThe easiest way to get started on your own test is to use the templates distributed at Gist Gist. There you can find latex files for examdesign and exam. Download it or copy and paste the contents of the Gist file into a new tex file, which we will assume is called MyRandomTest_examdesign.tex. You can also download the examdesign gist file in R using:\n\nsetwd('Your path goes here')\ndownload.file(url = 'https:\/\/gist.github.com\/msperlin\/ef1b93a8eb9026ba5e9a\/raw\/MyRandomTest_examdesign.tex', destfile = 'MyRandomTest_examdesign.tex' )\n\nOnce you have the Latex file, run the following script to build 5 random tests, each with 4 questions:\n\nlibrary(RndTexExams)\n\nmy.d <- 'Your folder to the tex file here!'\nsetwd(my.d)\n\nf.in <- 'MyRandomTest_examdesign.tex'\nf.out <- 'RandomTest-'\nn.test <- 5\nn.question <- 4\nlatex.dir.out <- 'latexOut'\npdf.dir.out <- 'PdfOut'\n\nlist.out <- rte.analyze.tex.file(f.in,\nlatex.dir.out = latex.dir.out,\npdf.dir.out = pdf.dir.out)\n\nout <- rte.build.rdn.test(list.in = list.out,\nf.out = f.out,\nn.test = n.test,\nn.question = n.question,\nlatex.dir.out = latex.dir.out) \n\nThe five pdf files named RandomTest-1.pdf, RandomTest-2, and so on should be now available in folder pdfOut.\n\n\u2022 By default, examdesign prints the answer sheet of each test. If you are printing the final version of exam, it is likely that you don\u2019t want the correct answers printed in the exam! Simply add \\NoKey in the preamble of the latex file. The example latex file is already configured this way.","date":"2018-02-25 09:53:44","metadata":"{\"extraction_info\": {\"found_math\": true, \"script_math_tex\": 0, \"script_math_asciimath\": 0, \"math_annotations\": 0, \"math_alttext\": 0, \"mathml\": 0, \"mathjax_tag\": 0, \"mathjax_inline_tex\": 1, \"mathjax_display_tex\": 0, \"mathjax_asciimath\": 1, \"img_math\": 0, \"codecogs_latex\": 0, \"wp_latex\": 0, \"mimetex.cgi\": 0, \"\/images\/math\/codecogs\": 0, \"mathtex.cgi\": 0, \"katex\": 0, \"math-container\": 0, \"wp-katex-eq\": 0, \"align\": 0, \"equation\": 0, \"x-ck12\": 0, \"texerror\": 0, \"math_score\": 0.5157634615898132, \"perplexity\": 2486.6388087560535}, \"config\": {\"markdown_headings\": true, \"markdown_code\": true, \"boilerplate_config\": {\"ratio_threshold\": 0.18, \"absolute_threshold\": 10, \"end_threshold\": 15, \"enable\": true}, \"remove_buttons\": true, \"remove_image_figures\": true, \"remove_link_clusters\": true, \"table_config\": {\"min_rows\": 2, \"min_cols\": 3, \"format\": \"plain\"}, \"remove_chinese\": true, \"remove_edit_buttons\": true, \"extract_latex\": true}, \"warc_path\": \"s3:\/\/commoncrawl\/crawl-data\/CC-MAIN-2018-09\/segments\/1518891816351.97\/warc\/CC-MAIN-20180225090753-20180225110753-00561.warc.gz\"}"}
null
null
Q: Selecting values only for last day of month I have a query that's supposed to grab only the value for the last day of the month from all my existing records (so the last day of multiple months). I'm unable to get the value I'm needing for ONLY the last day, due to using a SUM() clause. This is adding all the values for the whole month together. Can I get only the value for the last day another way? Is there something I'm missing? Code so far: SELECT ID, [Customer Name], Year([ValDate]) & IIf(Len(Month([ValDate]))>1,Month([ValDate]),"0" & Month([ValDate])) AS BalMonth, Sum(Value) AS LastValue FROM Archive GROUP BY ID, [Customer Name], Year([ValDate]), Month([ValDate]) ORDER BY ID, Year(ValDate) & Month(ValDate) Other Code tested: SELECT ID, [Customer Name], YEAR([ValDate]) & MONTH([ValDate]) & MAX(DAY([BalDate])) AS LastDayofMonth FROM Archive GROUP BY ID , [Customer Name], YEAR([ValDate]), MONTH([ValDate]) ORDER BY ID, [Customer Name], YEAR([ValDate]), MONTH([ValDate]) The second section of code didn't work as it produces the dates in YYYYMMDD format. This makes it so it doesn't allow proper ordering of the dates. Instead, the dates are being ordered as 1 , 10 , 11 , 12 , 2 , 3 , 4 , etc. If anything is unclear I'll try my best to clarify, just let me know! A: Try something like: SELECT ID, [Customer Name], [ValDate] AS LastDayofMonth, Sum([FieldToSum]) As Total FROM Archive GROUP BY ID, [Customer Name], [ValDate] HAVING [ValDate] = DateSerial(Year([ValDate]), Month([ValDate]) + 1, 0) Edit: To have a formatted date output, try this: SELECT ID, [Customer Name], Format([ValDate], "yyyymmdd") AS LastDayofMonth, Sum([FieldToSum]) As Total FROM Archive WHERE [ValDate] = DateSerial(Year([ValDate]), Month([ValDate]) + 1, 0) GROUP BY ID, [Customer Name], Format([ValDate], "yyyymmdd")
{ "redpajama_set_name": "RedPajamaStackExchange" }
8,593
<?xml version="1.0" encoding="UTF-8"?> <project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <modelVersion>4.0.0</modelVersion> <groupId>org.myeslib</groupId> <artifactId>myeslib</artifactId> <version>0.0.1-SNAPSHOT</version> <packaging>pom</packaging> <properties> <!-- default maven settings --> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <maven.build.timestamp.format>yyyy-MM-dd HH:mm</maven.build.timestamp.format> <build.date>${maven.build.timestamp}</build.date> <java.version>1.7</java.version> <camel.version>2.13.0</camel.version> <hazelcast.version>3.2</hazelcast.version> </properties> <repositories> <repository> <snapshots> <enabled>false</enabled> </snapshots> <id>central</id> <name>bintray</name> <url>http://jcenter.bintray.com</url> </repository> </repositories> <modules> <module>myeslib-core</module> <module>myeslib-jdbi</module> <module>myeslib-hazelcast</module> <module>myeslib-util</module> <module>myeslib-3rd-party</module> <module>inventory-aggregate-root</module> <module>inventory-jdbi</module> <module>inventory-hazelcast</module> <module>inventory-cmd-producer</module> <module>inventory-database</module> </modules> <dependencyManagement> <dependencies> <!-- Core --> <dependency> <groupId>${project.groupId}</groupId> <artifactId>myeslib-core</artifactId> <version>${project.version}</version> </dependency> <!-- Implementations --> <dependency> <groupId>${project.groupId}</groupId> <artifactId>myeslib-jdbi</artifactId> <version>${project.version}</version> </dependency> <dependency> <groupId>${project.groupId}</groupId> <artifactId>myeslib-hazelcast</artifactId> <version>${project.version}</version> </dependency> <!-- Utility --> <dependency> <groupId>${project.groupId}</groupId> <artifactId>myeslib-util</artifactId> <version>${project.version}</version> </dependency> <dependency> <groupId>${project.groupId}</groupId> <artifactId>myeslib-3rd-party</artifactId> <version>${project.version}</version> </dependency> <!-- Inventory example --> <dependency> <groupId>${project.groupId}</groupId> <artifactId>inventory-aggregate-root</artifactId> <version>${project.version}</version> </dependency> <dependency> <groupId>${project.groupId}</groupId> <artifactId>inventory-jdbi</artifactId> <version>${project.version}</version> </dependency> <dependency> <groupId>${project.groupId}</groupId> <artifactId>inventory-hazelcast</artifactId> <version>${project.version}</version> </dependency> <dependency> <groupId>${project.groupId}</groupId> <artifactId>inventory-cmd-producer</artifactId> <version>${project.version}</version> </dependency> <dependency> <groupId>${project.groupId}</groupId> <artifactId>inventory-database</artifactId> <version>${project.version}</version> </dependency> <!-- Others --> <dependency> <groupId>org.projectlombok</groupId> <artifactId>lombok</artifactId> <version>1.12.4</version> </dependency> <dependency> <groupId>ch.qos.logback</groupId> <artifactId>logback-classic</artifactId> <version>1.0.13</version> </dependency> <dependency> <groupId>org.jdbi</groupId> <artifactId>jdbi</artifactId> <version>2.51</version> </dependency> <dependency> <groupId>org.apache.camel</groupId> <artifactId>camel-core</artifactId> <version>${camel.version}</version> </dependency> <dependency> <groupId>org.apache.camel</groupId> <artifactId>camel-jetty</artifactId> <version>${camel.version}</version> </dependency> <dependency> <groupId>org.apache.camel</groupId> <artifactId>camel-gson</artifactId> <version>${camel.version}</version> </dependency> <dependency> <groupId>com.hazelcast</groupId> <artifactId>hazelcast</artifactId> <version>${hazelcast.version}</version> </dependency> <dependency> <groupId>com.google.guava</groupId> <artifactId>guava</artifactId> <version>15.0</version> </dependency> <dependency> <groupId>com.google.inject</groupId> <artifactId>guice</artifactId> <version>3.0</version> </dependency> <dependency> <groupId>com.google.inject.extensions</groupId> <artifactId>guice-assistedinject</artifactId> <version>3.0</version> </dependency> <dependency> <groupId>com.google.code.gson</groupId> <artifactId>gson</artifactId> <version>2.2.4</version> </dependency> <dependency> <groupId>com.h2database</groupId> <artifactId>h2</artifactId> <version>1.3.175</version> </dependency> <!-- <dependency> --> <!-- <groupId>com.oracle</groupId> --> <!-- <artifactId>ojdbc7</artifactId> --> <!-- <version>12.1.0.1</version> --> <!-- </dependency> --> <dependency> <groupId>com.zaxxer</groupId> <artifactId>HikariCP</artifactId> <version>1.2.1</version> <scope>compile</scope> </dependency> <!-- Test --> <dependency> <groupId>com.googlecode.flyway</groupId> <artifactId>flyway-core</artifactId> <version>2.3</version> <scope>test</scope> </dependency> <dependency> <groupId>org.apache.camel</groupId> <artifactId>camel-test</artifactId> <version>${camel.version}</version> <scope>test</scope> </dependency> <dependency> <groupId>junit</groupId> <artifactId>junit</artifactId> <version>4.11</version> <scope>test</scope> </dependency> <!-- <dependency> --> <!-- <groupId>org.assertj</groupId> --> <!-- <artifactId>assertj-core</artifactId> --> <!-- <version>1.3.0</version> --> <!-- <scope>test</scope> --> <!-- </dependency> --> <dependency> <groupId>org.hamcrest</groupId> <artifactId>hamcrest-all</artifactId> <version>1.3</version> <scope>test</scope> </dependency> <dependency> <groupId>org.mockito</groupId> <artifactId>mockito-all</artifactId> <version>1.9.5</version> <scope>test</scope> </dependency> </dependencies> </dependencyManagement> <build> <pluginManagement> <plugins> <plugin> <groupId>org.codehaus.mojo</groupId> <artifactId>buildnumber-maven-plugin</artifactId> <version>1.2</version> <executions> <execution> <phase>validate</phase> <goals> <goal>create</goal> </goals> </execution> </executions> <configuration> <shortRevisionLength>7</shortRevisionLength> <!-- <doCheck>true</doCheck> <doUpdate>true</doUpdate> --> </configuration> </plugin> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-source-plugin</artifactId> <version>2.1.2</version> <executions> <execution> <id>attach-sources</id> <phase>package</phase> <goals> <goal>jar</goal> </goals> </execution> </executions> </plugin> <plugin> <groupId>org.codehaus.mojo</groupId> <artifactId>sonar-maven-plugin</artifactId> <version>2.0</version> </plugin> </plugins> </pluginManagement> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-antrun-plugin</artifactId> <version>1.7</version> </plugin> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-compiler-plugin</artifactId> <version>2.4</version> <configuration> <source>${java.version}</source> <target>${java.version}</target> <encoding>UTF-8</encoding> </configuration> </plugin> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-deploy-plugin</artifactId> <version>2.7</version> </plugin> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-resources-plugin</artifactId> <version>2.6</version> <configuration> <encoding>UTF-8</encoding> </configuration> </plugin> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-jar-plugin</artifactId> <version>2.4</version> </plugin> <plugin> <groupId>org.codehaus.mojo</groupId> <artifactId>sonar-maven-plugin</artifactId> </plugin> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-javadoc-plugin</artifactId> <version>2.9</version> <configuration> <charset>UTF-8</charset> </configuration> <executions> <execution> <id>jar</id> <phase>verify</phase> <goals> <goal>jar</goal> </goals> </execution> </executions> </plugin> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-assembly-plugin</artifactId> <version>2.3</version> </plugin> <!-- IDE --> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-eclipse-plugin</artifactId> <version>2.7</version> </plugin> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-release-plugin</artifactId> <version>2.4.1</version> <configuration> <tagNameFormat>@{project.version}</tagNameFormat> </configuration> </plugin> </plugins> </build> </project>
{ "redpajama_set_name": "RedPajamaGithub" }
8,993