\chapter{Nambu String}

Now, we want to step over from field theory to string theory. In classical field theory, we got information about our fields in different points of spacetime. Here, we don't have points anymore but one-dimensional objects, called strings. At a given moment, one can move along the string that may change with time. So we need two coordinates, if we want to describe an event on the string. Nevertheless, it is important to keep the theory Lorentz invariant, so we have to work in four-dimensional spacetime. A very practical way is to take the two-dimensional surface and embed it into Minkowski spacetime:
\begin{figure}[H]
\includegraphics[width=\textwidth]{img/string.pdf}
\caption{Embedding of the Nambu string into Minkowski spacetime}
\label{fig:8}
\end{figure}
Here, $\sigma$ and $\tau$ denote the coordinates of the string at rest (the parametrization) and $x^{\mu}(\sigma, \tau)$ are the coordinates in spacetime. They depend on the inertial observer and can be transformed into each other by a Lorentz transformation. The sections of all embedded points with surfaces of constant time define the string at that moment. We choose $\sigma \in [0,\pi]$ because it is very practical for Fourier transformation which is often used in string theory, but we also could have chosen a different range. \\

Let us see now which conditions the embedding functions $x^{\mu}(\sigma, \tau)$ have to fulfill. First of all, it is very common to consider a closed string, that means identifying the endpoints
\begin{align}
x^{\mu}(0, \tau) = x^{\mu}(\pi, \tau).
\end{align}
So the worldsheet of the string builds a kind of tube. \\

The second condition is that the string is not allowed to move faster than light ($\bar{v} \leq 1$). If a light signal is emitted on the string, the worldsheet is a cone with apex angle of $90^{\circ}$. The point of emission has to stay in the cone and is not allowed to exit (see Fig.~\ref{fig:8}). This corresponds to
\begin{align}
\dot{x}^2 = (\dot{x}^0)^2 - \dot{\bar{x}}^2 = \left( \frac{dx^0}{d\tau} \right)^2 - \left( \frac{d\bar{x}}{d\tau} \right)^2 \geq 1 - \left( \frac{d\bar{x}}{dx^0} \right)^2 \geq 0.
\end{align}

\pagebreak

And the last condition is that we want to have one time-like and one space-like vector. We found the time-like vector already which is just $\dot{x}^{\mu}$ because of the above condition. So we set the limitation
\begin{align}
(x')^2 < 0,
\end{align}
and define $x'$ to be the space-like vector. The square should be understand as the inner product with Minkowski metric like in the condition above.

\section{Lagrangian}
What is the Lagrangian for such a string?
We can try to rewrite the known Lagrangian of a relativistic point particle.
From special relativity, we know that the action of a point particle is
\begin{align}
S = - m \int \sqrt{1 - \bar{v}^2} \ dt = - m \int \sqrt{(dt)^2 - (d\bar{x})^2} = - m \int \sqrt{dx_{\mu}dx^{\mu}} = - m \int ds.
\end{align}
We see that the action corresponds to the "length" of the worldline of the particle, measured with Minkowski metric.
\begin{figure}[H]
\begin{center}
\includegraphics[width=\textwidth]{img/string_action.pdf}
\end{center}
\caption{Action of a relativistic point particle and a relativistic string}
\label{fig:9}
\end{figure}
Since now, we don't have a point which forms a worldline but a string which forms a "worldsuface", it is reasonable to take the area element instead of the line element and define
\begin{align}
S_{\text{str}} \equiv - \gamma \int dA,
\end{align}
where $\gamma$ is a proportionality constant. We will see later that this constant corresponds to the energy per unit length of the string.
But how to find the area element on the worldsheet of the string in Minkowski spacetime? \\

We will need a bit of differential geometry here. The area element on our flat parametrization would be given by $dA = d\sigma d\tau$. When we embed our surface into Minkowski spacetime, we have to consider the changing line elements (see Fig.~\ref{fig:10}):
\begin{align}
da^{\mu} &= \dot{x}^{\mu} d\tau \\
db^{\mu} &= x'^{\mu} d\sigma.
\end{align}
We could take this into account by using the generalized Jacobian determinant but we would like to show a more geometrical way.
\begin{figure}[H]
\begin{center}
\includegraphics[scale=1.1]{img/string_area.pdf}
\end{center}
\caption{Finding the area element $dA$}
\label{fig:10}
\end{figure}
If an area is spanned by two vectors $\bar{a}, \bar{b}$ in three-dimensional euclidean space, the area is just
\begin{align}
A = |\bar{a} \times \bar{b}| = |\bar{a}| |\bar{b}| \sin(\measuredangle(\bar{a},\bar{b})) = |\bar{a}| |\bar{b}| \sqrt{1 - \left( \frac{\bar{a} \cdot \bar{b}}{|\bar{a}| |\bar{b}|} \right)^2} = \sqrt{|\bar{a}|^2 |\bar{b}|^2 - \left( \bar{a} \cdot \bar{b} \right)^2}.
\end{align}
But how to do it in four-dimensional Minkowski spacetime? If we want to know the area element of an embedded surface, we have to know the induced metric $g_{a b}$ on the surface. In our case, the area element turns out to be very similar to the three-dimensional case
\begin{align}
dA = \sqrt{|g|} \ d\sigma \wedge \tau = \sqrt{(\dot{x}x')^2 - \dot{x}^2(x')^2} \ d\sigma \wedge \tau,
\end{align}
as we will see later. Here $(\dot{x}x')$ denotes the inner product with our Minkowski metric and $x^{\mu}$ still depends on $\sigma$ and $\tau$. So the action for the Nambu string is
\begin{align}
S_{\text{str}} = - \gamma \int dA &= - \gamma \int \sqrt{(\dot{x}x')^2 - \dot{x}^2(x')^2} \ d\sigma d\tau \notag \\
&= - \gamma \displaystyle\int\limits_{\tau_1}^{\tau_2} d\tau \displaystyle\int\limits_{0}^{\pi} d\sigma \sqrt{(\dot{x}x')^2 - \dot{x}^2(x')^2}.
\end{align}

If we identify $\tau$ as the proper time, we can read off the Lagrangian for the Nambu string:
\begin{align}
L[x^{\mu}(\sigma), \dot{x}^{\mu}(\sigma)] = - \gamma \displaystyle\int\limits_{0}^{\pi} d\sigma \sqrt{(\dot{x}x')^2 - \dot{x}^2(x')^2}.
\end{align}

\section{Hamiltonian}

Now that we have the Lagrangian for the Nambu string, we can continue to find the Hamiltonian and see which constraints we get. In some sense, the description of string theory is similar to that of electrodynamics, we just take the coordinates $x^{\mu}$ instead of the fields $A_{\mu}$ and get
\begin{align}
q_i(t) \ \ \longrightarrow \ \ x^{\mu}(\sigma, \tau),
\end{align}
so the index $i$ is now given by $\mu$ and the position $\sigma$ on the string. The generalized momentum is therefore
\begin{align}
p_{\mu}(\sigma) = \frac{\delta L}{\delta \dot{x}^{\mu}(\sigma)}.
\end{align}
Let us calculate it for the Nambu string:
\begin{align}
p_{\mu}(\sigma) &= \frac{\delta L}{\delta \dot{x}^{\mu}(\sigma)} =  - \gamma \displaystyle\int\limits_{0}^{\pi} d\tilde{\sigma} \ \frac{2 (\dot{x}x') \frac{\delta(\dot{x}^{\nu}x'_{\nu})}{\delta \dot{x}^{\mu}(\sigma)} - (x')^2 \frac{\delta (\dot{x}^{\nu}\dot{x}_{\nu})}{\delta \dot{x}^{\mu}(\sigma)}}{2 \sqrt{(\dot{x}x')^2 - \dot{x}^2(x')^2}} \notag \\
&= - \gamma \displaystyle\int\limits_{0}^{\pi} d\tilde{\sigma} \ \frac{(\dot{x}x') \delta_{\mu}^{\nu} \delta(\sigma - \tilde{\sigma}) x'_{\nu} - (x')^2 \dot{x}_{\mu} \delta(\sigma - \tilde{\sigma})}{\sqrt{(\dot{x}x')^2 - \dot{x}^2(x')^2}} \notag \\
&= - \gamma \ \frac{(\dot{x}x') x'_{\mu} - (x')^2 \dot{x}_{\mu}}{\sqrt{(\dot{x}x')^2 - \dot{x}^2(x')^2}},
\end{align}
where the $x^{\mu}$ in the first and second line depend on $\tilde{\sigma}$ and in the last line on $\sigma$. It would be a difficult task to invert this equation and find $\dot{x}_{\mu}(p_{\mu})$ but fortunately we notice that
\begin{align}
px' \equiv p_{\mu}(\sigma) x'^{\mu}(\sigma) = - \gamma \ \frac{(\dot{x}x') (x')^2 - (x')^2 (\dot{x}x')}{\sqrt{(\dot{x}x')^2 - \dot{x}^2(x')^2}} = 0.
\end{align}

Moreover we have
\begin{align}
p^2 \equiv p_{\mu}(\sigma) p^{\mu}(\sigma) &= \gamma^2 \ \frac{(\dot{x}x')^2 (x')^2 - 2 (x')^2 (\dot{x}x')^2 + (x')^4 \dot{x}^2}{(\dot{x}x')^2 - \dot{x}^2(x')^2} \notag \\
&= - \gamma^2 \ \frac{(x')^2 \left[ (\dot{x}x')^2 - (x')^2 \dot{x}^2 \right]}{(\dot{x}x')^2 - \dot{x}^2(x')^2} \notag  \\
&= - \gamma^2 (x')^2.
\end{align}
So we get two primary constraints
\begin{align}
\phi_1(\sigma) &= p(\sigma) x'(\sigma) = 0 \\
\phi_2(\sigma) &= p^2(\sigma) + \gamma^2 x'^2(\sigma) = 0.
\end{align}

These are already all constraints that we can find because in our case:
\begin{align}
\text{Number of constraints} = 4 - \text{rank} \left( \frac{\delta^2 L}{\delta\dot{x}^{\mu} \delta\dot{x}^{\nu}} \right).
\end{align}
One can show by explicit calculation that the rank of this matrix is two and that we only have two constraints but we won't do it here. \\

The next step is to find the Hamiltonian:
\begin{align}
H[x^{\mu}(\sigma), p^{\mu}(\sigma)] &\equiv \displaystyle\int\limits_{0}^{\pi} d\sigma \ \dot{x}_{\mu}(\sigma)p^{\mu}(\sigma) + \gamma \displaystyle\int\limits_{0}^{\pi} d\sigma \sqrt{(\dot{x}x')^2 - \dot{x}^2(x')^2} \notag \\
&= \displaystyle\int\limits_{0}^{\pi} d\sigma \left( - \gamma \frac{(\dot{x}x')^2 - (x')^2 \dot{x}^2}{\sqrt{(\dot{x}x')^2 - \dot{x}^2(x')^2}} + \gamma \sqrt{(\dot{x}x')^2 - \dot{x}^2(x')^2} \right) \notag \\
&= 0.
\end{align}
We notice that it is zero and in fact, we didn't even had to calculate the Hamiltonian because we know from theorem~\ref{Theorem} that
\begin{equation}
\text{if} \ \ \ L[x^{\mu}(\sigma), \lambda \dot{x}^{\mu}(\sigma)] = \lambda L[x^{\mu}(\sigma), \dot{x}^{\mu}(\sigma)] \ \ \ \ \Longrightarrow \ \ \ \ H[x^{\mu}(\sigma), p^{\mu}(\sigma)] = 0.
\end{equation}

The total Hamiltonian is therefore
\begin{align}
H_T[x^{\mu}(\sigma), p^{\mu}(\sigma)] = \displaystyle\int\limits_{0}^{\pi} d\sigma \Bigg( u_1(\sigma)\underbrace{(p(\sigma)x'(\sigma))}_{=\phi_1(\sigma)} + u_2(\sigma) \underbrace{(p^2(\sigma) + \gamma^2 x'^2(\sigma))}_{=\phi_2(\sigma)}  \Bigg).
\end{align}

Are these constraints conserved at every moment or do we have secondary constraints? \\
We get the equation of motion by
\begin{align}
\dot{g} = \left \{ g,H_T \right \} = \displaystyle\int\limits_{0}^{\pi} d\sigma \left( u_1(\sigma) \left \{ g,\phi_1(\sigma) \right \}  + u_2(\sigma) \left \{ g,\phi_2(\sigma) \right \} \right),
\end{align}

where
\begin{align}
\left \{ f,g \right \} \equiv \displaystyle\int\limits_{0}^{\pi} d\sigma \left( \frac{\delta f}{\delta x^{\mu}(\sigma)} \frac{\delta g}{\delta p_{\mu}(\sigma)} - \frac{\delta g}{\delta x^{\mu}(\sigma)} \frac{\delta f}{\delta p_{\mu}(\sigma)} \right).
\end{align}

We have to check whether
\begin{align}
0 &\overset{?}{=} \dot{\phi}_1(\tilde{\sigma}) = \displaystyle\int\limits_{0}^{\pi} d\sigma \left( u_1(\sigma) \left \{ \phi_1(\tilde{\sigma}),\phi_1(\sigma) \right \}  + u_2(\sigma) \left \{ \phi_1(\tilde{\sigma}),\phi_2(\sigma) \right \} \right) \\
0 &\overset{?}{=} \dot{\phi}_2(\tilde{\sigma}) = \displaystyle\int\limits_{0}^{\pi} d\sigma \left( u_1(\sigma) \left \{ \phi_2(\tilde{\sigma}),\phi_1(\sigma) \right \}  + u_2(\sigma) \left \{ \phi_2(\tilde{\sigma}),\phi_2(\sigma) \right \} \right).
\end{align}

\pagebreak

Using the identity $\left \{ x^{\mu}(\sigma) , p_{\nu}(\tilde{\sigma}) \right \} = \delta_{\nu}^{\mu} \delta(\sigma - \tilde{\sigma})$ and calculating the poisson brackets accurately, one gets:
\begin{align}
\left \{ \phi_1(\tilde{\sigma}),\phi_1(\sigma) \right \} &=  (\phi_1(\sigma) + \phi_1(\tilde{\sigma})) \frac{\partial}{\partial \sigma}\delta(\sigma - \tilde{\sigma}) \\
\left \{ \phi_2(\tilde{\sigma}),\phi_2(\sigma) \right \} &= (\phi_1(\sigma) + \phi_1(\tilde{\sigma})) \frac{\partial}{\partial \sigma}\delta(\sigma - \tilde{\sigma}) \\
\left \{ \phi_1(\tilde{\sigma}),\phi_2(\sigma) \right \} &= (\phi_2(\sigma) + \phi_2(\tilde{\sigma})) \frac{\partial}{\partial \sigma}\delta(\sigma - \tilde{\sigma}).
\end{align}
So when we insert this in the above equations for $\dot{\phi}_1$ and $\dot{\phi}_2$, we see that they can be expressed by the constraints themself and therefore vanish on the constraint surface. \\
So these two constraints are first-class constraints and we get no secondary constraints, $u_1$ and $u_2$ stay arbitrary. \\

Since we have two arbitrary functions in our Hamiltonian, we have mathematical degrees of freedom or gauge freedom. The constraints are generators of gauge transformations.

What transformations do they generate?
\begin{align}
\delta g = \varepsilon_m \left\{ g,\phi_m \right\} \ \ \ \Longrightarrow \ \ \ \delta g = \displaystyle\int\limits_{0}^{\pi} d\tilde{\sigma} \ \varepsilon(\tilde{\sigma}) \left\{ g,\phi(\tilde{\sigma}) \right\}.
\end{align}

Let's see which transformations $\phi_1$ generates for the coordinates $x^{\mu}$:
\begin{align}
\delta x^{\mu}(\sigma) &=  \displaystyle\int\limits_{0}^{\pi} d\tilde{\sigma} \ \varepsilon_1(\tilde{\sigma}) \left \{ x^{\mu}(\sigma),(p_{\nu}(\tilde{\sigma}) x'^{\nu}(\tilde{\sigma}) ) \right \} \notag \\
&=  \displaystyle\int\limits_{0}^{\pi} d\tilde{\sigma} \ \varepsilon_1(\tilde{\sigma}) x'^{\nu}(\tilde{\sigma}) \left \{ x^{\mu}(\sigma),p_{\nu}(\tilde{\sigma}) \right \} \notag \\
&= \varepsilon_1(\sigma) x'^{\mu}(\sigma) .
\end{align}
How to interpret this result? One can see that this is just the first order of the Taylor expansion of $x^{\mu}(\sigma + \varepsilon_1(\sigma))$:
\begin{align}
x^{\mu}(\sigma) \ \longrightarrow \ \tilde{x}^{\mu}(\sigma) = x^{\mu}(\sigma) + \varepsilon_1(\sigma) x'^{\mu}(\sigma) = x^{\mu}(\overbrace{\sigma + \varepsilon_1(\sigma)}^{= \tilde{\sigma}}).
\end{align}
So the transformation corresponds to a shift of the variable $\sigma$. That's why we have to impose the conditions
\begin{align}
\varepsilon_1(0) = \varepsilon_1(\pi) = 0,
\end{align}
to not exit the interval $[0,\pi]$:
\begin{align}
\tilde{\sigma}(0) &= 0 \\
\tilde{\sigma}(\pi) &= \pi.
\end{align}

It turns out that this transformation is a map from the string to itself. What changes effectively is the parametrization of the string but not the form of the string itself. \\
It's like we would reparametrize a path. Since we have many possible ways to choose a parametrization, this corresponds to a high degree of freedom. \\

For this moment, we don't want to concentrate on the possible gauge transformations. The other transformations can be found easily, analog to the above procedure. Rather, we want to consider a concrete gauge (a concrete value of the arbitrary functions) and see what dynamics follow from it.

\section{Dynamics}

Let us choose the gauge:
\begin{align}
u_1(\sigma) &= 0 \\
u_2(\sigma) &= \frac{1}{2 \gamma}
\end{align}

and calculate the Hamiltonian equations of motion for the coordinates:
\begin{align}\label{eq:78}
\dot{x}^{\mu}(\sigma) &= \left \{ x^{\mu}(\sigma), \frac{1}{2 \gamma} \displaystyle\int\limits_{0}^{\pi} d\tilde{\sigma} \left( p^2(\tilde{\sigma}) + \gamma^2 x'^2(\tilde{\sigma}) \right) \right \} \notag \\
&= \frac{1}{2 \gamma} \displaystyle\int\limits_{0}^{\pi} d\tilde{\sigma} \ 2 p^{\mu}(\tilde{\sigma}) \delta(\sigma - \tilde{\sigma}) \notag \\
&= \frac{p^{\mu}(\sigma)}{\gamma}
\end{align}

and for the momenta:
\begin{align}\label{eq:79}
\dot{p}^{\mu}(\sigma) &= \left \{ p^{\mu}(\sigma), \frac{1}{2 \gamma} \displaystyle\int\limits_{0}^{\pi} d\tilde{\sigma} \left( p^2(\tilde{\sigma}) + \gamma^2 x'^2(\tilde{\sigma}) \right) \right \} \notag \\
&= \frac{1}{2 \gamma} \displaystyle\int\limits_{0}^{\pi} d\tilde{\sigma} \ 2 \gamma^2 x'^{\nu}(\tilde{\sigma}) (- \delta^{\mu}_{\nu}) \frac{\partial}{\partial \tilde{\sigma}}\delta(\sigma - \tilde{\sigma}) \notag \\
&= \gamma x''^{\mu}(\sigma).
\end{align}

Inserting these results into our constraints $\phi_1(\sigma)$ and $\phi_2(\sigma)$, we get the conditions
\begin{align}
\dot{x}^2 + (x')^2 &= 0 \\
\dot{x} x' &= 0,
\end{align}
which means that $x'$ and $\dot{x}$ are orthogonal. That is why we call them \textit{orthonormal gauge}.

Moreover we can take the time-derivative of equation \eqref{eq:78} and insert equation \eqref{eq:79} to get the equation of motion
\begin{equation}\label{eq:eom}
\ddot{x}^{\mu}(\sigma, \tau) - x''^{\mu}(\sigma, \tau) = 0.
\end{equation}

This looks much like the equation $\partial_a \partial^a x^{\mu}(\sigma, \tau) = 0$, where $a = 1,2$ denote the derivative with respect to $\tau$ and $\sigma$, with signature $(+ -)$. That's why we would like to show the connection between $1+1$ gravity and the Nambu string before continuing with the dynamics.

\begin{example}[$1+1$ Gravity]
We want to illustrate the connection between the string and $1+1$ gravity, that is, one time-dimension and one space-dimension.
When we embed the string in Minkowski space, it can have curvature. What is the metric?
The easiest way to find out the components of the metric is to look at the invariant line element
\begin{align}
dx^{\mu} &= \dot{x}^{\mu} d\tau + x'^{\mu} d\sigma \\
ds^2 &= dx_{\mu}dx^{\mu} = \dot{x}^2 (d\tau)^2 + 2 \dot{x} x' d\tau d\sigma + (x')^2 (d\sigma)^2.
\end{align}
From here we can read off the metric since $ds^2 = g_{ab} \ dx^a dx^b$:
\begin{align}
g_{ab} =
\begin{pmatrix}
    \dot{x}^2 & \dot{x} x' \\
    \dot{x} x' & (x')^2
  \end{pmatrix}
\end{align}
and with our orthonormal gauge conditions, we get
\begin{align}
g_{ab} =
\begin{pmatrix}
    \dot{x}^2 & 0 \\
    0 & - \dot{x}^2
  \end{pmatrix}
= \dot{x}^2
\begin{pmatrix}
    1 & 0 \\
    0 & -1
  \end{pmatrix},
\end{align}
which is a conformally flat metric.
So we showed that the "worldsurface" of the string (like every two-dimensional Riemannian manifold) is conformally flat. This means that for every point on this surface, one can find a neighborhood that can be mapped to flat space by a conformal transformation (one that preserves orientation and angles locally).
The signature is $(+ -)$ like expected.

Let's take a closer look at the action of the string again:
\begin{align}
S = - \gamma \int d\tau d\sigma \sqrt{(\dot{x} x')^2 - \dot{x}^2 (x')^2}.
\end{align}
We notice that the expression under the square root is exactly the negative of the determinant of the metric:
\begin{align}
g \equiv \mbox{det}(g_{ab}) = \dot{x}^2(x')^2 - (\dot{x}x')^2.
\end{align}
So we can write the action of the string as
\begin{align}
S = - \gamma \int d\tau d\sigma \sqrt{- g}
\end{align}
which is a kind of Einstein-Hilbert action for $1+1$ gravity, where $\gamma$ plays the role of a gravity constant. In $3+1$ gravity it takes the form
\begin{align}
S = \frac{1}{2 \kappa} \int d^4 x \ \sqrt{- g} \ (R + \Lambda).
\end{align}
The string can be easily generalized to higher dimensions.
\end{example}

Let us continue with the dynamics of the Nambu string. We have still enough gauge freedom to set
\begin{align}
t = x^0(\sigma, \tau) = \tau.
\end{align}
This choice is often used and leads to some simplifications in our dynamics. \\

It implies that
\begin{align}
\arraycolsep=1.4pt\def\arraystretch{1.5}
\begin{array}{ll}
\dot{x}^0 = \frac{\partial x^0}{\partial \tau} = \frac{\partial \tau}{\partial \tau} = 1 \ \ \ & \ \ \ x'^0 = 0 \\
\dot{\bar{x}} = \frac{\partial \bar{x}}{\partial \tau} = \frac{\partial \bar{x}}{\partial t} = \bar{v} \ \ \ & \ \ \ \bar{x}' = \frac{\partial \bar{x}}{\partial \sigma},
\end{array}
\end{align}
which leads in connection with our constraints to
\begin{align}
\dot{x} x' = - (\dot{\bar{x}} \bar{x}') = 0
\end{align}
and
\begin{align}
\dot{x}^2 + (x')^2 = (1 - \dot{\bar{x}}^2) - (\bar{x}')^2 = 0.
\end{align}
So we can replace our orthonormal gauge conditions by
\begin{align}
\dot{\bar{x}}^2 + (\bar{x}')^2 &= 1 \\
\dot{\bar{x}} \bar{x}' &= 0
\end{align}
and the equation of motion \eqref{eq:eom} turns to
\begin{align}
\ddot{\bar{x}}(\sigma, \tau) - \bar{x}''(\sigma, \tau) = 0.
\end{align}

So all our constraints and the equation of motion reduced to three dimensions.
Let's see how we can rewrite our Lagrangian:
\begin{align}
L &= - \gamma \displaystyle\int\limits_{0}^{\pi} d\sigma \sqrt{(\dot{x}x')^2 - \dot{x}^2(x')^2} \notag \\
&= - \gamma \displaystyle\int\limits_{0}^{\pi} d\sigma \ \sqrt{0 - (1 - \bar{v}^2) (- (\bar{x}')^2)} \notag \\
&= - \gamma \displaystyle\int\limits_{0}^{\pi} d\sigma \ \left| \bar{x}' \right|  \sqrt{1 - \bar{v}^2}.
\end{align}
It reduces also to three dimensions and looks quite similar to the Lagrangian of a relativistic point particle: $L = - m \sqrt{1 - \bar{v}^2}$. Let us define the length $S$ of the string:
\begin{align}
S = \displaystyle\int\limits_{0}^{\pi} d\sigma \ \left| \bar{x}' \right| = \displaystyle\int\limits_{0}^{S} ds.
\end{align}

Then we get in analogy to the relativitic point particle:
\begin{align}
dm = \gamma \ ds \ \ \ \Longrightarrow \ \ \ \gamma = \frac{dm}{ds}.
\end{align}

We see that $\gamma$ corresponds to the mass/energy of the string per unit length as mentioned before.


\documentclass{article}[12]
\usepackage{amssymb}
\usepackage{graphicx}
\usepackage{suetterl}
\usepackage[T1]{fontenc}
%\usepackage{showframe}
\title{S\"utterlin and Fraktur Characters in Mathematics.}
\author{James Waddington}
\date{Last updated: \today}
\begin{document}
\maketitle
\section{Introduction} Back in Spring 2014 I audited a course with John Steele at Berkeley. One minor stumbling block I had was his use of S\"utterlin in lieu of Fraktur for models on the board, so I thought I would collect them. If anyone knows of any common usages of Fraktur you should let me know.

\section{Tables of Characters}
\subsection{Common Characters}

\begin{tabular}{c | c | c | p{6cm}}
    Fraktur & Latin & S\"utterlin & Common Instances\\\hline
    $\mathfrak{A}$ & $A$ &\suetterlin{A} & Models\\
    $\mathfrak{B}$ & $B$ &\suetterlin{B} & Models\\
    $\mathfrak{C}$ & $C$ &\suetterlin{C} & Models\\
    $\mathfrak{H}$ & $H$ &\suetterlin{H} & \\
    $\mathfrak{L}$ & $L$ &\suetterlin{L} & \\
    $\mathfrak{M}$ & $M$ &\suetterlin{M} & Models\\
    $\mathfrak{N}$ & $N$ &\suetterlin{N} & Models (Often models of arithmetic)\\
    $\mathfrak{R}$ & $R$ &\suetterlin{R} & Models (Often of Real Closed Fields), Jacobson Radical\\
    $\mathfrak{a}$ & $a$ &\suetterlin{a} & Ideals\\
    $\mathfrak{b}$ & $b$ &\suetterlin{b} & Ideals\\
    $\mathfrak{c}$ & $c$ &\suetterlin{c} & Ideals, Cardinality of $\mathbb{R}$\\
    $\mathfrak{m}$ & $m$ &\suetterlin{m} & Maximal Ideals\\
    $\mathfrak{p}$ & $p$ &\suetterlin{p} & Prime Ideals\\
\end{tabular}

\subsection{Exhaustive List}
\begin{tabular}{c | c | c || c | c | c }
    Fraktur & Latin & S\"utterlin & Fraktur & Latin & S\"utterlin \\\hline
    $\mathfrak{A}$ & $A$ &\suetterlin{A} &
    $\mathfrak{B}$ & $B$ &\suetterlin{B} \\
    $\mathfrak{C}$ & $C$ &\suetterlin{C} &
    $\mathfrak{D}$ & $D$ &\suetterlin{D} \\
    $\mathfrak{E}$ & $E$ &\suetterlin{E} &
    $\mathfrak{F}$ & $F$ &\suetterlin{F} \\
    $\mathfrak{G}$ & $G$ &\suetterlin{G} &
    $\mathfrak{H}$ & $H$ &\suetterlin{H} \\
    $\mathfrak{I}$ & $I$ &\suetterlin{I} &
    $\mathfrak{J}$ & $J$ &\suetterlin{J} \\
    $\mathfrak{K}$ & $K$ &\suetterlin{K} &
    $\mathfrak{L}$ & $L$ &\suetterlin{L} \\
    $\mathfrak{M}$ & $M$ &\suetterlin{M} &
    $\mathfrak{N}$ & $N$ &\suetterlin{N} \\
    $\mathfrak{O}$ & $O$ &\suetterlin{O} &
    $\mathfrak{P}$ & $P$ &\suetterlin{P} \\
    $\mathfrak{Q}$ & $Q$ &\suetterlin{Q} &
    $\mathfrak{R}$ & $R$ &\suetterlin{R} \\
    $\mathfrak{S}$ & $S$ &\suetterlin{S} &
    $\mathfrak{T}$ & $T$ &\suetterlin{T} \\
    $\mathfrak{U}$ & $U$ &\suetterlin{U} &
    $\mathfrak{V}$ & $V$ &\suetterlin{V} \\
    $\mathfrak{W}$ & $W$ &\suetterlin{W} &
    $\mathfrak{X}$ & $X$ &\suetterlin{X} \\
    $\mathfrak{Y}$ & $Y$ &\suetterlin{Y} &
    $\mathfrak{Z}$ & $Z$ &\suetterlin{Z} \\

    $\mathfrak{a}$ & $a$ &\suetterlin{a} &
    $\mathfrak{b}$ & $b$ &\suetterlin{b} \\
    $\mathfrak{c}$ & $c$ &\suetterlin{c} &
    $\mathfrak{d}$ & $d$ &\suetterlin{d} \\
    $\mathfrak{e}$ & $e$ &\suetterlin{e} &
    $\mathfrak{f}$ & $f$ &\suetterlin{f} \\
    $\mathfrak{g}$ & $g$ &\suetterlin{g} &
    $\mathfrak{h}$ & $h$ &\suetterlin{h} \\
    $\mathfrak{i}$ & $i$ &\suetterlin{i} &
    $\mathfrak{j}$ & $j$ &\suetterlin{j} \\
    $\mathfrak{k}$ & $k$ &\suetterlin{k} &
    $\mathfrak{l}$ & $l$ &\suetterlin{l} \\
    $\mathfrak{m}$ & $m$ &\suetterlin{m} &
    $\mathfrak{n}$ & $n$ &\suetterlin{n} \\
    $\mathfrak{o}$ & $o$ &\suetterlin{o} &
    $\mathfrak{p}$ & $p$ &\suetterlin{p} \\
    $\mathfrak{q}$ & $q$ &\suetterlin{q} &
    $\mathfrak{r}$ & $r$ &\suetterlin{r} \\
    $\mathfrak{s}$ & $s$ &\suetterlin{s} &
    $\mathfrak{t}$ & $t$ &\suetterlin{t} \\
    $\mathfrak{u}$ & $u$ &\suetterlin{u} &
    $\mathfrak{v}$ & $v$ &\suetterlin{v} \\
    $\mathfrak{w}$ & $w$ &\suetterlin{w} &
    $\mathfrak{x}$ & $x$ &\suetterlin{x} \\
    $\mathfrak{y}$ & $y$ &\suetterlin{y} &
    $\mathfrak{z}$ & $z$ &\suetterlin{z} \\
\end{tabular}
\end{document}


\paragraph{Accounting for Uncertainty:} \label{sec:acct_uncertainty}
An AIA that can predict its performance on different tasks can provide assurances about competence, predictability, and the situational normality of a given task. Several researchers have worked to improve this ability in visual classification \cite{Zhang2014-he,Gurau2016-hs,Churchill2015-ei,Kaipa2015-hy}.
For example, to ensure that visual classifiers don't fail silently in novel scenarios, \citet{Zhang2014-he} learned models of errors on training images to predict errors on test images. \citet{Kaipa2015-hy} consider 3D visual classification of assembly line parts for robotic pick and place tasks, and develop statistical goodness-of-fit tests to estimate the likelihood that robots can use their sensors to find parts matching desired ones. These approaches allow the AIA to assess capability and present appropriate assurances to users, though without any formal notions of trust.

\citet{Mitchell2018-jw}, discuss, in the context of a `never ending learning problem' (i.e. where the AIA perpetually learns over time), how an agent can quantify uncertainty on unlabeled data given three requirements: 1) three or more approximations of a function are available, 2) the assumption that these functions are more accurate than chance, and 3) these functions have independent errors. The rates at which these functions agree on classification of unlabeled examples can be used to solve for their exact accuracies. Doing this allows the system to actively reduce uncertainty, by seeking relevant data.
In the context of image classification, \citet{Paul2011-vr} introduced `perplexity' as a metric that represents uncertainty in predicting a single class and is used to select the `most perplexing' images for further learning. There have also been several attempts to use Gaussian processes (GPs) to actively learn and assign probabilistic classifications \cite{MacKay1992-sp,Triebel2016-kj,Triebel2013-ow,Triebel2013-ku,Grimmett2013-gj,Grimmett2016-yc,Berczi2015-rd,Dequaire2016-kh}. As with perplexity-based classifiers, the key insight is that if a classifier possesses a measure of uncertainty, then that uncertainty can be used for efficient instance searching, comparison, and learning, as well as reporting a measure of confidence to users. The key property of GPs to this end is their ability to produce output confidence/uncertainty estimates that grow more uncertain away from the training data. This information can be readily assessed and conveyed to users, even in high-dimensional problems. This property has also found much use in other AIA active learning problems, e.g. Bayesian optimization \cite{Snoek2012-tt, Brochu2010-tj,Israelsen2017-zb}.

Neural network (NN) models are commonly considered black-box models, and methods to represent uncertainty have not historically been available. However, there have been several recent advances to make this possible to some extent~\cite{Gal2016-om,Gal2016-eq}. Bayesian neural networks (BNNs) are a method by which we can draw insight about the uncertainty of a neural network's predictions; this is possible by placing prior distributions over the weights in a NN. \citet{Kendall2017-ry}, in the context of computer vision, also use deep BNNs to help visualize epistemic (input) and aleatoric (model) uncertainty for each pixel of an image.
Similarly, \citet{Kahn2017-vy} use deep BNNs to learn about the probability (with uncertainty) of an autonomous vehicle colliding in an environment given its current state, observations, and sequence of controls. Using this model they formulate a `velocity-dependent collision cost' that is used for model-based reinforcement learning.
In order to help predict uncertainty in real-time robotic applications that learn from demonstrations, \citet{Choi2017-th} use mixture density networks (MDNs)---neural networks that learn parameters of a Gaussian mixture distribution---to model complex distributions from human demonstrations.

Models and logic are not trustworthy by themselves; they may be flawed to begin with, or become invalid when assumptions or specifications are violated. Thus, there is great interest in providing assurances that the models and assumptions underlying different AIA processes are in fact sound. \citet{Laskey1991-mf}---with the intention of communicating model validity to users of `probability-based decision aids'---notes that it is infeasible to perform a decision-theoretic calculation to determine if model revision is necessary. She presents a class of theoretically justified model revision indicators, based on the idea of constructing a computationally simple alternate model and then initiating model revision if the likelihood ratio of the alternate model becomes too large (see also \citet{Zagorecki2015-qy,Habbema1976-xd}). \citet{Ghosh2016-dl}  present `model repair' and `data repair' strategies that can be used when the current model does not match the observed data, at which point the model and data can be repaired, and control actions can be replanned in order to conform with the formal method specifications. One challenge is how the `trustable' constraints should be identified, as this places a strong burden on the certifying authorities and system designer to foresee all possible failures.


\newcommand{\flexible}{\em{Flexible}}

\newcommand{\pos}{\vect{x}}
\newcommand{\dx}{\vect{\Delta x}}
\newcommand{\xcur}{\vect{x}_{n}}
\newcommand{\xnext}{\vect{x}_{n+1}}
\newcommand{\vel}{\vect{v}}
\newcommand{\dv}{\vect{\Delta v}}
\newcommand{\vcur}{\vect{v}_{n}}
\newcommand{\vnext}{\vect v_{n+1}}
\newcommand{\acc}{\vect{a}}
\newcommand{\force}{\vect{f}}
\newcommand{\forcext}{\vect{f}_{ext}}
\newcommand{\lam}{\vect{\lambda}}
\newcommand{\lcur}{\lam_{n}}
\newcommand{\lnext}{\lam_{n+1}}
\newcommand{\avlam}{\bar{\lam}}
\newcommand{\fcur}{\vect{f}_{n}}
\newcommand{\fnext}{\vect f_{n+1}}
\newcommand{\Minv}{\mat M^{-1}}
\renewcommand{\P}{\mat P}
\newcommand{\cmp}{c}
\newcommand{\dampingratio}{d}

\newcommand{\p}{\vect{p}}  % moving point
\newcommand{\polynomial}[2]{{#1}^{#2}}  % polynomial coordinates of a point
\newcommand{\pp}{\polynomial{\p}{*}}  % polynomial coordinates of point p
\newcommand{\ppinit}{\polynomial{\pinit}{*}}  % polynomial coordinates of point \bar p
\newcommand{\initial}[1]{\bar{#1}}  % initial coordinates of a point
\newcommand{\pinit}{\initial{\p}}  % initial coordinates of a point
\newcommand{\pref}{\initial{\p}}  % reference (undeformed) point
\newcommand{\disp}{\vect{u}}  % displacement
\newcommand{\f}{\vect{f}}    % forces

\newcommand{\dof}{q}           % independent DOF
\newcommand{\dofinit}{\initial\dof}           % independent DOF
\newcommand{\dofpos}{\ensuremath{\vect{x}} }           % posititon in 3d of an independent DOF
\newcommand{\dofposinit}{\initial\dofpos }           % posititon in 3d of an independent DOF
\newcommand{\pdofposinit}{\polynomial{\dofposinit}{*}}
\newcommand{\pdofposinitcov}[1]{\polynomial{\dofposinit_#1}{*}\polynomial{\dofposinit_#1}{*T}}
\newcommand{\vdof}{\vect{\dof}}           % vector of independent DOF
\newcommand{\vdofinit}{\vect{\dofinit}}          % independent DOF
\newcommand{\fdof}{\f}           % force on independent DOF
\newcommand{\vfdof}{\vect{\fdof}}           % vector of independent DOF force
\newcommand{\dofm}{\mat{A}}         % DOF matrix
\newcommand{\dofmrel}{\mat{A^r}}         % DOF matrix
\newcommand{\mparam}{\theta}           % material parameter
\newcommand{\vmparam}{\vect{\mparam}}           % material points
\newcommand{\defograd}{F}           % deformation gradient
\newcommand{\fdefograd}{\mathcal{F}}           % deformation gradient generalized force
\newcommand{\strain}{\epsilon}           % strain
\newcommand{\stress}{\sigma}           % stress
\newcommand{\W}{\mathcal{W}}           % elastic energy
\newcommand{\C}{\mat{C}}           % damping matrix

\newcommand{\volume}{\ensuremath{\mathcal{V}}}
\newcommand{\sample}{\ensuremath{{\mathcal{V}e}}}
\newcommand{\vol}{\ensuremath{\Delta v}}
\newcommand{\volmass}{\ensuremath{\rho}}
\newcommand{\mass}{\mat{M}}

\newcommand{\ddof}{\ensuremath{\dot{\dof}}}
\newcommand{\dddof}{\ensuremath{\ddot{\dof}}}
\newcommand{\diff}{\ensuremath{\boldsymbol{\nabla}_i}}

\newcommand{\Jt}{\J^T}

\newcommand{\mCoord}{\vect{\Theta}}
\newcommand{\shapef}{w}

\newcommand{\MappingArrows}{\ensuremath{\left. \begin{array}{c} \stackrel{\JNL}{\longrightarrow} \\ \stackrel{\J}{\longrightarrow} \\ \stackrel{\Jt}{\longleftarrow} \end{array}\right.} }

\begin{abstract}
This plugin provides a unified approach to the simulation of deformable solids using a multi-layer kinematic structure: control nodes, deformation gradients, strains, and new mappings between these.
This approach maximizes the modularity of the implementation.
FEM and meshless models use different position-deformation mappings. The remaining components (strain measures, constitutive laws) are common to the two approaches.
\end{abstract}

\section{Introduction Example}

The goal of this plugin is to improve the modularity of deformable solid simulation.
Figure~\ref{fig modularity mass-spring} shows an example of the increased modularity.
In \sofa{}, mass-spring systems are traditionally modeled using three components for  state, mass and penalty force respectively.
The force component $F_s$ in fig.\ref{fig mass-spring-traditional} is in charge of computing the distance and its gradient between the two particles, as well as to apply a constitutive law (typically linear viscoelastic).
In this plugin, we provide new components to split these computations and make the framework more modular.
In the example shown in fig.\ref{fig mass-spring-flexible}, a mapping represented by an arrow is used to compute spring extensions $X_e$ based on particle positions $X_p$.
A constitutive law $F_e$ is applied to the extensions, and the corresponding force is mapped upward to the particles through the mapping.
This is more modular since the linear viscoelastic constitutive law can be replaced with a different one, while re-using the same mapping from positions to extensions. In the traditional approach, extension computation would have to be re-implemented in the new force field.
Moreover, in the new approach, the penalty force can also be replaced with a hard constraint, while re-using the same mapping (see also the Compliant plugin about soft and hard constraints).
More generally, complex components are decomposed in simple and re-usable components using mappings, to allow a unified approach to the simulation of deformable solids using mass-spring, FEM and mesh-less models.
\begin{figure}
 \centering
 \begin{subfigure}[t]{0.36\linewidth} \centering
   \includegraphics[clip,trim=0mm 285mm 155mm 0mm]{mass-spring.pdf}
   \caption{Two masses and a spring.} \label{fig mass-spring}
 \end{subfigure}
 \begin{subfigure}[t]{0.3\linewidth} \centering
   \includegraphics[clip,trim=50mm 285mm 130mm 0mm]{mass-spring.pdf}
   \caption{Traditional \sofa{} scene graph.} \label{fig mass-spring-traditional}
 \end{subfigure}
 \begin{subfigure}[t]{0.3\linewidth} \centering
   \includegraphics[clip,trim=80mm 280mm 100mm 0mm]{mass-spring.pdf}
   \caption{A more modular data structure.} \label{fig mass-spring-flexible}
 \end{subfigure}
 \caption{Improved modularity. $X$ denotes a state component, $M$ is mass, and $F$ a force field, while arrows represent mappings. $X_p$ represents particle positions while $X_e$ represents spring extensions, and $F_s$ represents spring forces while $F_e$ represent extension forces.}
 \label{fig modularity mass-spring}
\end{figure}

\section{Three-layer Continuum Mechanics}
The Flexible plugin provides components to model Lagrangian deformable solids using three layers, as illustrated in fig.\ref{fig tree levels}.
We present an overview of these and refer to subsequent sections for more detail.
\begin{figure}
 \centering
 \includegraphics[height=0.3\linewidth]{threeLevels.pdf}
 \caption{The deformable solid in the left is modeled using the three kinematic levels shown in the right.
 The red disks, the grey squares and the local frames respectively represent the control nodes, the integration points and the deformation gradients at these points.
 }\label{fig tree levels}
\end{figure}

The top level contains the control nodes, which carry the independent degrees of freedom (DOF) of the object in state vectors $\vect \dof$
and $\dot{\vect\dof}$ for positions and velocities, respectively .
In this example we use standard finite element (FE) nodes, but these could be any set of generalized coordinates such as moving frames, or deformation modes.
The shape functions represent how the material space of the object is mapped to the world space, based on the DOF. They are discussed in sec.\ref{sec shape functions}.

The second level contains deformation gradients, which represent the local state of the continuum, like small reference frames painted on the object.
Each of these is typically influenced by several control nodes in the upper level.
Their basis vectors are orthonormal in the undeformed configuration, while departure from unity corresponds to compression or extension, and departure from orthogonality corresponds to shear.

The deformation gradients are computed using a mapping based on the control nodes and their associated shape functions.
Different mappings are used depending on the type of control nodes (points, frame, etc.) and shape functions (linear or higher level interpolation, RBF, etc.). These mappings are presented in sec.\ref{sec deformation mapping}.
The deformation gradients are evaluated at carefully chosen sample points associated with object regions, which volumes are used to compute spatial integrals across the object. Sampling and quadrature are discussed in sec.\ref{sec quadrature}.

The lower level contains measures of deformation, typically called strains.
Each of these typically correspond to one deformation gradient at the upper level.
There are several ways of measuring deformation, including the well-known Cauchy strain, Green-Lagrange strain and corotational strain which for 3D objects are $3 \times 3$ symmetric tensors, or scalar values such as the determinant of the deformation gradient.
Different mappings are used to evaluate the different types of strain, as presented in sec.\ref{sec strain mapping}.

The constitutive law of the object material is applied at the lower level to compute stress $\stress$ based on strain $\strain$.
More detail is given in sec.\ref{sec materials}.
The vector of stresses $\vect \stress$ is mapped upward to generalized forces $\vect \fdefograd$ homogeneous to deformation gradients, which are multiplied by the sample size and possibly other volume moments to integrate across the object volume.
These generalized forces are then mapped upward to node forces.

Mass can be integrated at the middle level using volume samples, or set at the top level.

This flexible architecture allows us to easily create models by re-using available parts. In the example shown in fig.\ref{fig tree levels frame}, the frame-based meshless model~\cite{gilles:frame:TOG11,faure:framesteak:11} can be modeled using the same type of deformation gradients, strains and material laws as the FEM model in fig.\ref{fig tree levels}.
Only the top layer (independent DOFs and associated shape functions), the mapping to the deformation gradients and the sampling method differ.
\begin{figure}
 \centering
 \includegraphics[page=2,height=0.3\linewidth]{threeLevels.pdf}
 \caption{A frame-based meshless model}\label{fig tree levels frame}
\end{figure}

%--------------------------------------------------------------------------------------------
\section{Shape functions} \label{sec shape functions}

\subsection{Shepard}

Shepard shape functions correspond to inverse distance weights (\url{http://en.wikipedia.org/wiki/Inverse_distance_weighting}).

They are defined as $\shapef_i(\mCoord)=1/|| \mCoord-\mCoord_i ||^p$ followed by normalization.

\subsection{Barycentric}

Barycentric shape functions are the barycentric coordinates of points inside cells (can be edges, triangles, quads, tetrahedra, hexahedra).
They achieve first order consistency: $\mCoord= \sum \shapef_i \mCoord_i$

\subsection{Natural Neighbors}

Natural neighbor interpolants are based on Voronoi diagrams.
Currently, Voronoi diagrams are computed from an image (a rasterized object).

\subsection{to do}

\begin{itemize}
 \item higher order FEM
 \item clarify material vs. spatial coordinates
 \item
\end{itemize}

%--------------------------------------------------------------------------------------------
\section{Deformation mapping} \label{sec deformation mapping}

\subsection{linear mapping}

Child positions are computed as a linear combination of parent node dofs.
For instance, the mapping from points to points is : $\p = \sum_i w_i (\vdof - \vdofinit)$.
The mapping from affine frames to points in homogeneous coordinates is : $\p = \sum_i w_i \vdof \vdofinit^{-1} \pinit$.

\subsection{Extension mapping}

\subsection{Distance mapping}

\subsection{Log rigid mapping}

\subsection{Relative rigid mapping}

\subsection{Triangle deformation mapping}

\subsection{to do}

\begin{itemize}
 \item Moving Least squares
 \item non-linear skinning
 \item clarify material vs. spatial coordinates
 \item model plasticity/control using relative mappings
 \item
\end{itemize}

%--------------------------------------------------------------------------------------------
\section{Strain mapping} \label{sec strain mapping}

\subsection{Green-Lagrangian strain}

The strain is mapped from the deformation gradient as : $\mat{E} = (\defograd^T\defograd - \mat{I} )/2$.
Here the strain is stored into vectors using Voigt notation. In 3d, we have: $\strain = [\strain_{xx} , \strain_{yy} , \strain_{zz} , 2\strain_{xy} , 2\strain_{yx} , 2\strain_{xz} ] $
The energy conjugate SPK stress vector is $\stress = [\stress_{xx} , \stress_{yy} , \stress_{zz} , \stress_{xy} , \stress_{yx} , \stress_{xz} ] $

\subsection{Corotational strain}

The rigid displacement $\mat{R}$ is first extracted from the deformation gradient using, for instance, SVD, polar or QR decomposition.
Then, supposing that the non-rigid deformation $\mat{R}^T \defograd$ is small enough, we can apply the Cauchy strain formulation:  $\mat{E} = [\mat{R}^T \defograd + \defograd^T \mat{R} ) /2 - \mat{I} $.

The geometric stiffness contribution does not seem necessary because it does not visually change the behaviour but can compromise the stability.
\begin{itemize}
\item analytical QR decomposition jacobians given in "Finite Random Matrix Theory, Jacobians of Matrix Transforms (without wedge products)", Alan Edelman, 2005, http://web.mit.edu/18.325/www/handouts/handout2.pdf (UNSTABLE)
\item Polar decomposition gradients inspired by Jernej Barbic, Yili Zhao, "Real-time Large-deformation Substructuring" SIGGRAPH 2011 (UNSTABLE)
\item SVD gradients given in Christopher Twigg, Zoran Kacic-Alesic, "Point Cloud Glue: Constraining simulations using the Procrustes transform", SCA'10 (QUITE STABLE)
\end{itemize}

\subsection{Principal stretches}

The principles streches $\mat{U}$ are directly extracted from the deformation gradient using a SVD, where the principal streches can be deduce from the eigen-values.
Note that the corresponding stress is also represented by 3 values, so isotropic materials are not applicable.

The geometric stiffness contribution is important.
\begin{itemize}
\item SVD gradients given in T. Papadopoulo, M.I.A. Lourakis, "Estimating the Jacobian of the Singular Value Decomposition: Theory and Applications", European Conference on Computer Vision, 2000 (STABLE)
\end{itemize}

\subsection{Diagonal strain}

The diagonal strain $\mat{D}$ is the principles streches + additional terms to allow anisotropic materials.

\subsection{Invariants of deformation tensor}

The elastic energy of some materials are expressed using the three invariants of the right Cauchy deformation tensor $\mat{C}=\defograd^T \defograd$ :

\begin{itemize}
 \item $I1(\mat{C}) = trace(\mat{C})$
 \item $I2(\mat{C}) = ( trace(\mat{C}^2)+trace(\mat{C})^2 )/2$
 \item $I3(\mat{C}) = det(\mat{C})$
\end{itemize}

In practice, deviatoric invariants are used:
\begin{itemize}
 \item $\tilde{I1}(\mat{C}) = I1(\mat{C})/det(\defograd)^{2/3}$
 \item $\tilde{I2}(\mat{C}) = I2(\mat{C})/det(\defograd)^{4/3}$
\end{itemize}

Invariants are homogeneous with energies, so we use their squared roots as the state vectors.

\subsection{to do}

\begin{itemize}
 \item fix undefined invariants for inverted/flat elements
 \item
 \item
\end{itemize}

%--------------------------------------------------------------------------------------------
\section{Materials} \label{sec materials}

\subsection{Hooke Force field}

Hooke materials have linear strain/stress relationships: $\stress=\mat{H}\strain$.
The potential energy is $W= \int_{\volume} \strain^T\mat{H}\strain /2$.

\subsection{Mooney Rivlin}

The potential energy is $W= \int_{\volume} [ C1 ( I1 - 3)  + C2 ( I2 - 3) ]$, where $C1$ and $C2$ are material constants.

\subsection{Volume preservation}

Possible energy formulations for volume conservation are :
\begin{itemize}
 \item $W= \frac{k}{2} \int_{\volume} log( det(\defograd) )^2$
 \item $W= \frac{k}{2} \int_{\volume} (det(\defograd)-1)^2$
\end{itemize}
where $k$ is the bulk modulus.

\subsection{to do}

\begin{itemize}
 \item merge with implemented fem materials (Costa, Arruda-Boyce, NeoHookean, Veronda)
 \item
 \item
\end{itemize}

\newpage
%--------------------------------------------------------------------------------------------
\section{Quadrature} \label{sec quadrature}

Quadrature points are sampled using one of the GaussPointSampler component.
Currently, samplers can take meshes or images as inputs.

Quadrature methods estimate integrals using a sum of weighted evaluations at sample positions: $\int_{\volume} f(\pinit) d\volume \approx \sum_i v_i f(\pinit_i) $

\subsection{Mid-point}

The simplest method is to take one point per region and weight the value by its volume.
This is exact only for constant functions (e.g., elastic energy in a first order tetrahedral FEM)

\subsection{Gauss-Legendre}

Several points are used to approximate the intergral of higher order functions.
Currently only first order Gauss-Legendre quadrature on hexahedra is implemented.

\subsection{Elastons}

The idea is to decompose $f$ on a basis: $f(\pinit)=\mat{c}(\pinit_0) \polynomial{(\pinit-\pinit_0)}{*}$,
where $\mat{c}$ are the coeficients and $\polynomial{()}{*}$ the basis vector (for instance the first order polynomial basis $[1,x,y,z]$).
The integral is then estimated as  $\int_{\volume} f(\pinit) d\volume \approx \mat{c}(\pinit_0)  \int_{\volume} \polynomial{(\pinit-\pinit_0)}{*} d\volume = \sum_i v_i c_i(\pinit_0) $
where the coeeficient $v_i$ part can be precomputed using an arbitrary fine discretization.

\subsection{to do}

\begin{itemize}
 \item Newton Cotes
 \item Finish implementation of elastons. Required instanciations for all force fields..
 \item
\end{itemize}

\appendix

\section{Background - to rephrase}
This section contains material which needs rephrasing.

The numerical simulation of continuous deformable objects is based on a discrete number of independent degrees of freedom (DOFs) which we will call the nodes. They are kinematic primitives (can be points, frames, etc.).

Nodes are associated with shape functions which are combined to produce the displacement function of material points in the solid.

We introduce the following notations:
\begin{itemize}
 \item $\vdofinit$, $\vdof$ and $\fdof$ : the initial positions, current positions, and forces of the nodes.
 \item $\mCoord$ : the material coordinates of a point according the chosen parameterization of the solid.
 \item $\pinit(\mCoord)$, $\p (\mCoord)$ : the initial and current position of a point in space
 \item $\disp (\mCoord) =\p-\pinit$ : the displacement of a point
 \item $\shapef_i(\mCoord)$ : the shape function associated with node $i$
\end{itemize}

The local deformation is computed by differentiation with respect to material coordinates. The deformation gradient is: $\defograd = \partial \p / \partial \mCoord$.

The elastic deformation is described using a strain measure based on the deformation gradient.

These three stages can be modeled using \sofa{} mappings:

\begin{equation}
\left. \begin{array}{ccccc}
\mbox{Nodes}  & \MappingArrows &   \mbox{Deformation gradients} & \MappingArrows &  \mbox{Strains}
\end{array}\right.
\end{equation}

The elastic potential energy is computed from the strain.

After spatial integration (quadrature), we obtain associated forces (total stress), that can be back propagated to the nodes using transposed jacobians.

\begin{equation}\label{eq:f}
 \vfdof = - \frac{\partial \W}{\partial \vdof}^T =  - \Jt_0\Jt_1 \int_{\volume} \stress
\end{equation}

Force variations are updated at each mapping by combining material and geometric stiffnesses. For a mapping from $p$ to $c$, we have:

\begin{equation}
 \delta(\vfdof_p) = ( \Jt \K_c \J + \frac{\partial \Jt}{\partial \vdof_p} \vfdof_c ) \delta(\vdof_p)
\end{equation}

\newpage
%--------------------------------------------------------------------------------------------
\section{Scene graph}

\begin{itemize}
 \item \textbf{State =} nodes
 \item Shape function

 \item \textbf{ELASTICITY:}
  \begin{itemize}
  \item Gauss point sampler
  \item \textbf{State =} deformation gradients
  \item \textbf{Mapping =} deformation mapping

  \item \textbf{MATERIAL:}
    \begin{itemize}
    \item \textbf{State =} strains
    \item \textbf{Force field}
    \item \textbf{Mapping =} strain mapping
    \end{itemize}
  \end{itemize}

 \item \textbf{MASS:}
    \begin{itemize}
    \item \textbf{State =} points
    \item Mass
    \item \textbf{Mapping =} deformation mapping
    \end{itemize}
 \item \textbf{COLLISION:}
    \begin{itemize}
    \item \textbf{State =} points
    \item \textbf{Mapping =} deformation mapping
    \end{itemize}
 \item \textbf{VISU:}
    \begin{itemize}
    \item \textbf{State =} points
    \item \textbf{Mapping =} deformation mapping
    \end{itemize}

\end{itemize}

\bibliographystyle{plain}
\bibliography{Flexible}


\documentclass{beamer}
\usetheme{Madrid}
\usepackage[utf8]{inputenc}
\DeclareMathOperator*{\argmax}{arg\,max}
\DeclareMathOperator*{\argmin}{arg\,min}
\DeclareMathOperator{\sign}{sign}

\title[Multi-agent Dynamics in the SFBP]{Multi-agent Dynamics in the Santa Fe Bar Problem}
\subtitle{Fairness and efficiency}
\author{Angelo Ortiz}
\institute{SMA @ LIP6}
\date{\today}

\begin{document}

\begin{frame}
\titlepage
\end{frame}

\begin{frame}
\frametitle{Outline}
\tableofcontents
\end{frame}

\section{Presentation}
\subsection{Definitions}
\begin{frame}
\frametitle{The SFBP}
\begin{block}<1->{Brian Arthur:}
\begin{quote}
 $N$ people decide independently each week whether to go to a bar that offers entertainment on a certain night... Space is limited, and the evening is enjoyable if things are not too crowded -- especially, if fewer than $c$ percent of the possible $N$ are present... a person or agent goes if she expects fewer than $c$ percent to show up and stays home if she expects more than $c$ percent to go.
\end{quote}
\end{block}

\begin{block}<2->{Only datum}
 Previous attendance numbers.
\end{block}

\begin{alertblock}<3->{Restrictions}
 \begin{itemize}
  \item Choices are unaffected by previous visits.
  \item No collusion among the agents.
 \end{itemize}
\end{alertblock}

\end{frame}

\begin{frame}
\begin{definition}[Fairness]
An outcome is said to be fair if agents with identical utilities are equally likely to attend the bar.
\end{definition}

\begin{definition}[Efficiency]
Efficiency is a measure of collective, or total agent, utility achieved relative to its maximum value.
\end{definition}

\end{frame}

\subsection{Formalisation}
\begin{frame}
 \frametitle{Formalisation}
 \begin{block}{Notations}
 \begin{itemize}
  \item Agents: $\mathcal{N}=\{1,...,N\}$, with $n \in \mathcal{N}$.
  \item The strategy set $S_n = \{0, 1\}$ for agent $n$, where 0 denotes \textit{stay home} while 1, \textit{go to the bar}.
  \item $Q_n$ denotes the set of probability distributions over $S_n$, with mixed strategy $q_n \in Q_n$.
  \item $s_n$ denotes the realisation of agent $n$'s mixed strategy $q_n$; thus, the bar attendance is $s=\sum_{n \in \mathcal{N}} s_n$.
  \item Externality : if $s \leq c$, then $E(s) = 0$; otherwise, $E(s) = 1$.
  \item $\alpha_n \in ]0,1[$ denotes the value to player $n$ of attending the bar.
  \item Payoff function: $\pi(s_n, s) = s_n (\alpha_n - E(s))$.
 \end{itemize}

 The agents population is denoted by $\mathcal{N}=\{1,...,N\}$, with $n \in \mathcal{N}$.
 \end{block}
\end{frame}

\section{Efficient outcome}
\begin{frame}
 \frametitle{Fictitious play}
 \begin{block}{Notations}
 \begin{itemize}
  \item Uncrowdedness time: $a^0 = 0$, $a^{t+1}=a^t + E(s^t)$.
  \item Probability that the bar is uncrowded: $p^t = \frac{a^t}{t}$ \textcolor{red}{(Convergence)}.
  \item Conditioned on its own action: $b^0_n = c^0_n = 0$, $c^{t+1}_n = c^t_n + s^t_n$,
  $\left .b^{t+1}_n = b^t_n + \begin{cases}
      1 & \text{if } s^t \leq c \text{ and } s^t_n = 1 \\
      0 & \text{if } s^t > c \text{ and } s^t_n = 1
   \end{cases} \right.$, $p^t_n = \frac{b^t_n}{c^t_n}$.
   \item Expected utility at time $t+1$: $\mathbb{E}^{t+1}[\pi_n(s_n, s^t)] = \begin{cases}
      p^t_n\alpha_n - (1-p^t_n)(1-\alpha_n) & \text{if } s_n = 1 \\
      0 & \text{otherwise}
   \end{cases}$
   \item Chosen action at time $t+1$: $s^{t+1}_n \in \argmax_{s_n \in S_n} \mathbb{E}^{t+1}[\pi_n(s_n, s^t)]$
 \end{itemize}
 \end{block}
\end{frame}

\begin{frame}
 \begin{block}{Features}
 \begin{itemize}
  \item Rationality.
  \item Utility-maximising: bar attendance $\sim \frac{c}{N}$.
  \item Unfair: personal attendance likelihood converges to either 0 or 1.
  \item Pure strategy Nash equilibrium.
 \end{itemize}
 \end{block}
\end{frame}

\section{Fair outcome}
\begin{frame}
 \frametitle{No-regret learning}
 \begin{block}<1->{Notations}
 \begin{itemize}
  \item Cumulative utility through time $t$ with strategy $s_n$: $P^t_n(s_n) = \sum_{x=1}^t \pi_n(s_n, s^x)$.
  \item Weight assigned to strategy $s_n$ at time $t+1$, for $\beta > 0$: $q^{t+1}_n(s_n) = \frac{(1+\beta)^{P^t_n(s_n)}}{\sum_{s'_n \in S_n} (1+\beta)^{P^t_n(s'_n)}}$.
 \end{itemize}
 \end{block}

 \begin{block}<2->{Features}
 \begin{itemize}
  \item Bounded rationality.
  \item Fair: personal attendance $\sim \frac{c}{N}$.
  \item Inefficient: collective utility near 0.
  \item Mixed strategy Nash equilibrium.
 \end{itemize}
 \end{block}
\end{frame}

\section{Fair \& efficient mechanism}
\begin{frame}
 \frametitle{Q-learning}
 \begin{block}<1->{Notations}
 \begin{itemize}
  \item Utility function, for the bar attendance $\lambda \in \mathbb{N}$ and $\sigma_i \geq 0$: $u_i(\lambda) = \max\{1-\frac{(\lambda - \mu_i)^2}{\sigma_i^2}, 0\}$, where $\mu_i$ is agent $i$'s utility-peak bar attendance.
  \item Taxation scheme: charge people attending the bar an entrance fee, and distribute this sum among those that stayed home.
  \item \textit{Derivative-following} approach: $f_{t+1} = f_t+\gamma[\sign(f_t-f_{t-1})\sign(u_t-u_{t-1})]$, where $u_t$ is the agents' average utility at time $t$.
 \end{itemize}
 \end{block}

 \begin{block}<2->{Features}
 \begin{itemize}
  \item Bounded rationality.
  \item Fee and average utility per agent converge to about 0.5.
  \item Fair and approximately efficient.
 \end{itemize}
 \end{block}
\end{frame}

\section{Some results \& foreseeable work}
\begin{frame}
\frametitle{Some results \& foreseeable work}
\begin{definition}[Predictivity]
 Given $\epsilon > 0$, a belief-based learning algorithm is said to be $\epsilon$-predictive for player $n$ iff it generates a sequence of probabilistic beliefs $\{p^t_n\}$ s.t.:
 \[
 \lim_{t \to \infty} |p^t_n - p^t_0| < \epsilon.
 \]
\end{definition}

\begin{block}{Rationality vs Learning}
 Rationality precludes learning.
\end{block}
\end{frame}

\begin{frame}
\begin{block}{Envisioned tasks}
 \begin{itemize}
  \item Implement the aforementioned algorithms and replicate the results.
  \item Analyse a variable-utility setup.
  \item Work with other fairness and/or efficiency definitions.
  \item (Optimise the setup with heterogeneous agents.)
  \item (Transpose to the two-bar problem setup.)
 \end{itemize}

\end{block}
\end{frame}

\section*{References}
\begin{frame}
\frametitle{References}
\begin{enumerate}
 \item W.B. Arthur. Inductive reasoning and bounded rationality. Complexity in Economic Theory, 84(2):406–411,
1994.
\item A. Greenwald, A. Jafari, G. Ercal, and D. Gondek. On no-regret learning, Nash equilibrium, and fictitious play.
In Proceedings of Eighteenth International Conference on Machine Learning, pages 226–233, June 2001.
\item A. Greenwald, B. Mishra, and R. Parikh. The Santa Fe bar problem revisited: Theoretical and practical implica-
tions. Presented at Stonybrook Festival on Game Theory: Interactive Dynamics and Learning, July 1998.
\item Farago, Julie \& Greenwald, Amy \& Hall, Keith. (2003). Fair and Efficient Solutions to the Santa Fe Bar Problem.
\end{enumerate}
\end{frame}

\end{document}


\documentclass[simplex.tex]{subfiles}
% NO NEED TO INPUT PREAMBLES HERE
% packages are inherited; you can compile this on its own

\onlyinsubfile{
\title{NeuroData SIMPLEX Report: Subfile}
}

\begin{document}
\onlyinsubfile{
\maketitle
\thispagestyle{empty}

The following report documents the progress made by the labs of Randal~Burns and Joshua~T.~Vogelstein at Johns Hopkins University towards goals set by the DARPA SIMPLEX grant.

%%%% Table of Contents
\tableofcontents

%%%% Publications
\bibliographystyle{IEEEtran}
\begin{spacing}{0.5}
\section*{Publications, Presentations, and Talks}
%\vspace{-20pt}
\nocite{*}
{\footnotesize	\bibliography{simplex}}
\end{spacing}
%%%% End Publications
}

\subsection{Nonparametric Network Dependence Test}

Deciphering the association between network structures and corresponding nodal attributes of interest is a core problem in network science. We propose a new nonparametric procedure for testing dependence between network topology and nodal attributes, via diffusion maps and \texttt{MGC}. Specifically, under an exchangeable graph, we verify that the diffusion maps provide a set of conditionally independent multivariate coordinates for the nodes, which can be combined with \texttt{MGC} (or in general, any distance-based correlation measures) to yield consistent statistic for network dependence testing. In simulation, the new approach achieves superior testing performance under a variety of common network models than existing benchmarks. The diffusion maps provides a robust metric compared to adjacency matrix or geodesic distance, while \texttt{MGC} can better capture nonlinear dependencies, with their combined advantages shown in Figure~\ref{fig:threeSBM}.

\begin{figure}[h!]
\begin{cframed}
		\centering
		\includegraphics[width=0.6\textwidth]{../../figs/ThreeSBM.png}
		\caption{Power comparison for all possible combinations of metrics and correlation measure, under the stochastic block model with three blocks. \texttt{MGC} with the diffusion maps (DM) yields the best power, comparing to using other metrics like adjacency matrix (AM), latent factors (LF), and other test statistics like distance correlation (mcorr), Heller-Heller-Gorfine (HHG) test, or Fosdick and Hoff (FH) method.}
		\label{fig:threeSBM}
		\end{cframed}
\end{figure}

%In order to show that \texttt{MGC} combined with diffusion maps as a network metrics perform better even in the case arbitrary noisy is added to edges or the attributes in real data, we are doing an experiment on brain network with physical locations as nodal attributes. Our proposed method not only detects the dependence between network topology and nodal attributes but also helps us to reveal possibly diverse dependence patterns through multiscale correlation maps or multiscale statistics as a function of diffusion time.

This month we made significant progress in writing the manuscript and improving the exposition. The current draft was submitted to ASA Nonparametric Statistics Section Student Paper Awards, and we are notified as finalists for awards and special presentation section in the Joint Statistical Meeting this year.

\end{document}


\section{Parameters Summary}\label{app:parameters}

All the parameters used in this manuscript alongside their explanation are
given by Table~\ref{table:parameters_summary}.

\begin{table}[!htbp]
    \begin{center}
    \resizebox{.7\textwidth}{!}{
    \begin{tabular}{ll}
    \toprule
Feature & Explanation \\
 \midrule
SSE                       & A measure of how far a strategy is from extortionate behaviour defined in~\cite{Knight2019}. \\
$C_{\text{max}}$          & The biggest cooperating rate in the tournament. \\
$C_{\text{min}}$          & The smallest cooperating rate in the tournament. \\
$C_{\text{median}}$       & The median cooperating rate in the tournament. \\
$C_{\text{mean}}$         & The mean cooperating rate in the tournament. \\
$C_r$ / $C_{\text{max}}$    & A strategy's cooperating rate divided by the maximum cooperating rate in the tournament. \\
$C_{\text{min}}$ / $C_r$    & The minimum in the tournament divided by a strategy's cooperating rate. \\
$C_r$ / $C_{\text{median}}$ & A strategy's cooperating rate divided by the median cooperating rate in the tournament. \\
$C_r$ / $C_{\text{mean}}$   & A strategy's cooperating rate divided by the mean cooperating rate in the tournament. \\
$C_r$                       & The cooperating rate of a strategy. \\
$CC$ to $C$ rate            & The probability a strategy will cooperate after a mutual cooperation. \\
$CD$ to $C$ rate            & The probability a strategy will cooperate after being betrayed by the opponent. \\
$DC$ to $C$ rate            & The probability a strategy will cooperate after betraying the opponent. \\
$DD$ to $C$ rate            & The probability a strategy will cooperate after a mutual defection. \\
$p_n$                       & The probability of a player's action being flipped at each interaction. \\
$n$                         & The number of turns in a match. \\
$p_e$                       & The probability of a match ending in the next turn. \\
$N$                         & The number of strategies in the tournament. \\
$k$                         & The number that a given tournament is repeated. \\
    \bottomrule
        \end{tabular}}
    \end{center}
    \caption{The features which are included in the performance evaluation analysis.}\label{table:parameters_summary}
\end{table}


%% Dexter Barrows, 2016
%% dbarrows.github.io

\section{Spatial SIR R Function Code}

	R code to simulate the outlined Spatial SIR function.

	\lstinputlisting[style=Rsty]{../../code/sir-functions/StocSSIR.r}

\section{Spatial SIR HMC R Function Code}

	R code to simulate the outlined Spatial SIR function with HMC state reconstruction.

	\lstinputlisting[style=Rsty]{../../code/sir-functions/StocSSIRstan.r}

\section{RStan Spatial SIR Code}

    This code implements a Spatial SIR model in Rstan.

    \lstinputlisting[style=Rsty]{../../code/hmc/hmc-spa/sir-spa-euler.stan}

\section{IF2 Spatial SIR Code}

    This code implements a Spatial SIR model using IF2 in C++.

    \lstinputlisting[style=Cppsty]{../../code/if2/if2-spa/if2-spa.cpp}


% This LaTeX was auto-generated from an M-file by MATLAB.
% To make changes, update the M-file and republish this document.

      \subsection{getPlotDistr\_cp.m}

\begin{par}
\textbf{Summary:} Compute means and covariances of the Cartesian coordinates of the tips both the inner and outer pendulum assuming that the joint state $x$ of the cart-double-pendulum system is Gaussian, i.e., $x\sim N(m, s)$
\end{par} \vspace{1em}

\begin{verbatim}   function [M, S] = getPlotDistr_cp(m, s, ell)\end{verbatim}
    \begin{par}
\textbf{Input arguments:}
\end{par} \vspace{1em}
\begin{verbatim}m       mean of full state                                    [4 x 1]
s       covariance of full state                              [4 x 4]
ell     length of pendulum\end{verbatim}
\begin{verbatim}Note: this code assumes that the following order of the state:
       1: cart pos.,
       2: cart vel.,
       3: pendulum angular velocity,
       4: pendulum angle\end{verbatim}
\begin{par}
\textbf{Output arguments:}
\end{par} \vspace{1em}
\begin{verbatim}M      mean of tip of pendulum                               [2 x 1]
S      covariance of tip of pendulum                         [2 x 2]\end{verbatim}
\begin{par}
Copyright (C) 2008-2013 by Marc Deisenroth, Andrew McHutchon, Joe Hall, and Carl Edward Rasmussen.
\end{par} \vspace{1em}
\begin{par}
Last modification: 2013-03-27
\end{par} \vspace{1em}

\subsection*{High-Level Steps}

\begin{enumerate}
\setlength{\itemsep}{-1ex}
   \item Augment input distribution to complex angle representation
   \item Compute means of tips of pendulums (in Cartesian coordinates)
   \item Compute covariances of tips of pendulums (in Cartesian coordinates)
\end{enumerate}

\begin{lstlisting}
function [M, S] = getPlotDistr_cp(m, s, ell)
\end{lstlisting}

\subsection*{Code}

\begin{lstlisting}
% 1. Augment input distribution to complex angle representation
[m1 s1 c1] = gTrig(m,s,4,ell); % map input distribution through sin/cos
m1 = [m; m1];        % mean of joint
c1 = s*c1;           % cross-covariance between input and prediction
s1 = [s c1; c1' s1]; % covariance of joint

% 2. Compute means of tips of pendulums (in Cartesian coordinates)
M = [m1(1)+m1(5); -m1(6)];

% 3. Compute covariances of tips of pendulums (in Cartesian coordinates)
s11 = s1(1,1) + s1(5,5) + s1(1,5) + s1(5,1); % x+l sin(theta)
s22 = s1(6,6); % -l*cos(theta)
s12 = -(s1(1,6)+s1(5,6)); % cov(x+l*sin(th), -l*cos(th)

S = [s11 s12; s12' s22];
try
  chol(S);
catch
  warning('matrix S not pos.def. (getPlotDistr)');
  S = S + (1e-6 - min(eig(S)))*eye(2);
end
\end{lstlisting}


\documentclass[11pt,answers]{exam}

% Preamble % (fold)

\usepackage[paper=letterpaper,margin=.75in,twoside=false,includehead]{geometry}

\usepackage{amsfonts,amsmath,amsthm,amssymb}
\usepackage{enumerate}
\usepackage{graphicx}

\usepackage{paralist}
\usepackage{multicol}
\usepackage{bm}

\let\svthefootnote\thefootnote

\newtheorem*{thm}{Theorem}

\newcommand{\Z}{\mathbb{Z}}
\newcommand{\E}{\mathbb{E}}
\newcommand{\N}{\mathbb{N}}
\newcommand{\cP}{\mathcal{P}}
\newcommand{\Q}{\mathbb{Q}}
\newcommand{\R}{\mathbb{R}}
\newcommand{\e}{\varepsilon}

%\printsolutions

\title{Communicating in Mathematics (MTH 210) Exam 2}
\date{April 8, 2020}

\begin{document}

\maketitle

\section*{Instructions}

\noindent The following are very important, please read carefully!
\begin{itemize}
\item This exam must be uploaded to Blackboard by \textbf{April 9 at 5PM}. Please plan to try to upload before then so you can get help if there are issues.
\item Your exam should be scanned as a single PDF (with the app of your choosing) in black and white. Other file formats or color scans are sometimes too large for Blackboard to accept, and having to flip through multiple files makes grading difficult for Dr. Keough. You do not want to make grading difficult for your professors :)
\item You can write your answers on whatever paper you have, or print the exam if you've got a printer.
\item You do not need to write down the whole question, but you should do the following:
	\begin{itemize}
	\item Start each section on a new page.
	\item Clearly label at the top of \emph{every} page the section from which the problems are from.
	\item Number each problem as it is numbered on the exam.
	\end{itemize}
\item You may use your notes and your textbook for this exam. However, you may NOT use any other resources, including, but not limited to, your classmates, friends you know in other sections, Blackboard, the internet, your mom, your dog, etc. Violation of this policy will be penalized and could result in failure of the course.
\item There is no time limit on the exam, and you do not have to take it in one sitting. I do not expect this to take you more than 2 hours though!
\end{itemize}

\begin{center}
\textbf{If you aren't sure what to do, take a deep breath and just show me what you know. You'll be able to revise!}
\end{center}

\begin{center}

\begin{tabular}{|c|c|c|}
\hline
Section &Score\\
\hline
Sets &\\
&\\
\hline
Functions &\\
&\\
\hline
Which Proof Technique &\\
&\\
\hline
Proof Section &\\
&\\
\hline
\end{tabular}
\end{center}

\pagebreak

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\section{Sets}

\begin{questions}

\question This question is about definitions (and their negations) related to sets.  Describe precisely what you need to prove if you were trying to prove the following.

Let $A$ and $B$ be subsets of some universal set $U$.

\begin{parts}
\part   If I needed to prove that $A\subset B$ I would need to...
\vspace{.5in}
\part  If I needed to prove that $A= B$ I would need to...
\vspace{.5in}
\part If I needed to prove that $x\notin A \cap B$ I would need to...
\vspace{.5in}
\part  If I needed to prove that $x\in A - B$ I would need to...
\vspace{.5in}
\end{parts}

\question Let $U = \{x\in\Z : 1\leq x \leq 20\}$. Define $A = \{1,3,5,7,9,11,13,15,17,19\}$, $B = \{7,10,13\}$, and $C = \{x,y\}$. Make sure to use proper notation in each of the following!

\begin{parts}
\part Show $B\not\subseteq A$.
\vfill
\part Find $\mathcal{P}(C)$.
\vfill
\part Find $B\times C$.
\vfill
\part Find $|A\cup B|$, that is, the cardinality of $A\cup B$.
\vfill
\end{parts}

\end{questions}
\newpage

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\section{Functions}

\begin{questions}

\question

Let $f: \R\to\R$ be defined by $f(x) = \sin(x)$. (You may use graphing software to graph this.)

\begin{parts}
\part Explain why $f$ is a function. You should state the definition of function in your answer.
\vfill
\vfill
\part What is the codomain of $f$?
\vspace{.2in}
\part Use the word preimage in a sentence about the function $f$.
\vfill
\part Is $f$ an injection? Justify your answer using the definition of injection.
\vfill
\part Is $f$ a surjection? Justify your answer using the definition of surjection.
\vfill

%\part Is $f$ a bijection? Justify your answer using the definition of bijection.
%\vfill
\end{parts}

\question Let $A = \{1,2,3\}$ and $B = \{x,w\}$.
 Give an example of a function $f:A\to B$ that is a bijection or explain why no such example exists.
\vfill

\end{questions}

\newpage

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\section{Which Proof Technique When?}

Over the next 2 pages are 4 theorem statements with which you will need to do 3 things:
	\begin{itemize}
	\item State which proof technique you would use. Your options are: direct, contrapositive, contradiction, cases, and induction.
	\item Explain your choice of proof technique.\footnote{As a reminder - for the second bullet you should be specific - what was the key? Something about the hypothesis or conclusion?
}
	\item Outline the steps in a proof using the proof technique (but you should not actually attempt to prove the statement). You should say what you would assume and what you would try to prove. \footnote{In the third bullet you need to be detailed - for a proof by cases, what cases would you use? For a proof by induction, what steps would you use (and what's $P(k)$?)? In each case you need to be as specific as possible - do not say ``I would assume the negation", say what the negation actually is. }

	\end{itemize}
\emph{You should NOT actually prove any of the following theorems.}

\begin{questions}
\question Let $f_n$ be the $n^{th}$ Fibonacci number. For all natural numbers $n$, $3\mid f_{4n}$.

\vfill

\question For each integer $a$, $a^3 \equiv a \pmod{3}$.
\vfill
\newpage

%\question If $A = \{x\in\Z : x\equiv 0 \pmod{2}\}$ and $B = \{y\in \Z: y \equiv 0\pmod{4}\}$ then $A\subseteq B$.
%\vfill
\question For all integers $a$, if $a^2\not\equiv  0\pmod{3}$ then $a\not\equiv 0\pmod{3}$.
\vfill

\question For all $x,y\in \mathbb{R}$, and for all integers $a$ and $b$ with $b\neq 0$, if $x$ is rational and $y$ is irrational, then $ax+by$ is irrational.
\vfill

\end{questions}

\newpage

\section{Proofs}

IMPORTANT DIRECTIONS: You need to do both of the following proofs. Each proof needs to be written according to our writing guidelines.  Don't forget to include a theorem statement (which should always be declarative sentences)! The next page is for the first proof and the page after is for the second proof. Please include any scratch work you have in the PDF, but label it ``scratch work".

\begin{enumerate}
\item Prove the following theorem. The proof needs to be written according to our writing guidelines.

\begin{center}
For each $n\in\N$, $5\mid n^5+4n$.
\end{center}
It will probably be helpful for you to know that
\[(k+1)^5 = k^5+5k^4+10k^3+10k^2+5k+1.\]
You can use this without showing work for it.

\item Determine the relationship between the sets $A$ and $B$ and prove it. You should write your proof according to our writing guidelines.

\begin{center}
Let $A = \{x\in\Z : x\equiv 3 \pmod{6} \}$ and $B = \{ x\in \Z : 4\mid x\}$ . Determine a relationship between the sets $A$ and $B$, state the relationship as a theorem, and prove it.
\end{center}

\end{enumerate}

\newpage

\emph{If you printed the exam you can write your proof for  on this page. }

\newpage

\emph{If you printed the exam you can write your proof for 2 on this page. }

\end{document}


The main interest of interactive simulation is that the user can modify the course of the computations in real-time.
This is essential for surgical simulation : during a training procedure, when a virtual medical instrument comes into contact with some models of a soft-tissue, \emph{instantaneous} deformations must be computed.
This visual feedback of the contact can be enhanced by haptic rendering so that the surgeon can really "feel" the contact.

There are two main issues for a platform like SOFA for providing haptic: The first is that haptic forces need to be computed at $1kHz$ whereas real-time visual feedback (without haptic) is obtained at $30Hz$. The second is that haptic feedback can add artificially some energy inside the simulation and can create instabilities, if the control is not \emph{passive}.

Thus two different approaches are currently implemented into SOFA. The first one is the \emph{Virtual Coupling} technique and the other, more advanced, allows for rendering the constraints presented in section \ref{lm}.

\section{Virtual Coupling} Plugging of a haptic device is bidirectional: the user applies some motions or some forces on the device and this device, in return, applies forces and/or motions to the user.
The majority of the haptic devices propose a \emph{Impedance} coupling: the position of the device is provided by the API and this API asks for force values from the application.
A very simple scheme of coupling, presented in Fig\ref{fig:haptic1}, could have been used.
In this \emph{Direct coupling} case, the simulation would play the role of a controller in an open loop.

\begin{figure}
\centering
 \includegraphics[width=0.7\linewidth]{haptic1.png}
 \caption{Direct coupling}
 \label{fig:haptic1}
\end{figure}

Such design is not suitable when stable and robust haptic feedback on a virtual environment is desired. Indeed some combination of the environment impedance and human user reactions can destabilize the system \cite{Adams99}.
To avoid this, a virtual mechanical coupling is set. It corresponds to the use of a damped-stiffness between the position measured on the device and the simulated position in the virtual environment (see Fig\ref{fig:haptic2}). If very stiff constraints are being simulated then, the stiffness perceived by the user will not be infinite but will correspond to the stiffness of this virtual coupling.
Hence, a compromise between stability and performance must be found by tuning the stiffness value of the coupling.

\begin{figure}
\centering
 \includegraphics[width=\linewidth]{haptic2.png}
 \caption{Virtual coupling technique. A 6 DoFs Damped spring is placed between the haptic loop and the simulation.}
 \label{fig:haptic2}
\end{figure}

The damped spring is simulated two times. One time in the haptic loop and one time in the simulation loop.
If the two loops are synchronized, then the result is the same. But it can also be used in asynchronous mode: fast update of the haptic loop and low rates in the simulation.
In such case, the haptic feedback remains stable but the delay between the two loop is creating an artificial damping.
There is an option to cancel this artificial damping if no contact is detected in the simulation. However, this option can create a sensation of sticking contacts.
The main advantage of the virtual coupling technique is that it can be easily employed with every simulation of SOFA. The main drawback is that the haptic rendering is not transparent.

\section{Constraint-based rendering} An innovative way of dealing with haptic rendering for medical simulation has been proposed in the context of SOFA (see\footnote{The implementation of  \cite{Saupin08} is available in open-source, for the implementation of \cite{Peterlik11}, please contact: christian.duriez@inria.fr }  \cite{Saupin08} and \cite{Peterlik11}).
The approach deals with the mechanical interactions using appropriate force and/or motion transmission models named \emph{compliant mechanisms} (see Fig\ref{fig:haptic3}).
These mechanisms are formulated as a constraint-based problem (like presented in section \ref{lm}) that is solved in two separate threads running at different frequencies.
The first thread processes the whole simulation including the soft-tissue deformations, whereas the second one only deals with computer haptics.
With this approach, it is possible to describe the specific behavior of various medical devices while relying on a unified method for solving the mechanical interactions between deformable objects and haptic rendering.
\begin{figure}
\centering
 \includegraphics[width=\linewidth]{haptic3.png}
 \caption{Compliant mechanisms technique. The simulation shares the mechanical compliance of the objects and the constraints between them. The constraint response is being computed at low rate within the simulation and at high rates within a separate haptic thread. A 6 DoFs Damped spring is still used to coupled the position of the device to its position in the simulation}
 \label{fig:haptic3}
\end{figure}

\section{How to use it in SOFA ?}
Please see the web page: http://wiki.sofa-framework.org/wiki/Haptic  and use the tutorial "dentistry".


\section{Conclusions and Future Work}
The goal of this research is to find out what the best move is in the casino game Blackjack with each hand value and to confirm the thought that the dealer always wins more games than the player. \\
First the total number of wins: The simulation of Blackjack gives an accurate representation of the game. After playing one million games in this simulation, it shows that the dealer indeed wins more games than the player. 22 percent more games to be exact in the case of this simulation. So this proves the hypothesis, in Blackjack, the dealer wins more games than the player. \\
\\
The best move for the player is the move with the highest probability to win. For the values bellow 12 and over 17 this is clear, draw if under 12 and pass if over 17. Between these values these choice gets more difficult. The results shows for 12 and 13 a clear advantage to draw a card and for 16 and 17 a clear advantage by passing. But for 14 and 15 things get very close. On the long run, one should draw a card with a value of 14 and pass at a value of 15. So in short:
\begin{itemize}
    \item < 12: Draw
    \item 12: Draw
    \item 13: Draw
    \item 14: Draw
    \item 15: Pass
    \item 16: Pass
    \item 17: Pass
    \item > 17: Pass
\end{itemize}
This paper is based on generation one time, one million games of Blackjack. To further proof the working of this experiment in more depth, one could generate multiple sets of one million games of Blackjack and compare the differences between these sets. Expected is that the differences between these sets should be minimal. The only differences in the data will be coincidences, which should be canceled out by the large size of the dataset.


%================================
\section{Countability Axioms}
%================================


In Jaseci, a \emph{context element} represents a data element with a corresponding unique identifier of that data element. This abstraction is analogous to the traditional view of addressible memory in a computer system [CITE] for which which each word (data value) is addressible with a 32-bit or 64-bit memory address (identifier). However, a context element is untyped and in principle unbounded in size. Context have no requirements or restrictions for the kind or type of data element that is stored and only requires the identifier to be unique.

Though contexts are sufficent to enable all representations and management of data in the Jaseci machine, we also introduce the abstraction of \emph{context sets} that represents an explicit set of contexts bound to a single identifier. This \emph{context set} abstraction provides the utility of grouping, organizing, and handeling collections of related contexts as a single unit.
\begin{remark}
    \begin{tBox}
        The practical implmenetation of a Jaseci machine described in this book uses URN UUIDs [CITE] for the identifer.
    \end{tBox}
\end{remark}

\subsection{Formal Definition of Contexts and Context Sets}

Definitions~\ref{def:context} and~\ref{def:context_set} formally describe contexts and context sets.

\begin{definition}[context]
    \label{def:context}
    \index{context}
    A \emph{context} is a representation of data that can be expressed as a $2$-tuple $(k,v)$, where
    \begin{enumerate}
        \item $k$ is a unique identifier of the context
        \item $v$ is an encoding of the data represented by the context
    \end{enumerate}
\end{definition}

\begin{definition}[context set]
    \label{def:context_set}
    \index{context set}
    A \emph{context set} is a representation of data that can be expressed as a $2$-tuple $(k,C)$, where
    \begin{enumerate}
        \item $k$ is a unique identifier of the context set
        \item $C$ is an explicit finite set of contexts and context sets
    \end{enumerate}
\end{definition}

\subsection{Example}
\begin{example}
    For each trip a shopper has made to a grocery store, suppose we'd like to use contexts to represent what the shopper bought and the most expensive item.
    Let the set $I = \{ item_{1},\:item_{2},\:item_{3},\:\dots,\:item_{n}\}$ be the set of all distinct items in a given store and $P = \{item | item \in I \:\text{and was paid for by shopper}\}$ . We construct the context and context set
    \begin{align}
        A & = (k,\:item_{i}\:|\:\text{$item_{i}$ is the first $item \in I \land P$ sorted by cost.}) \\
        B & = (k, I \land P)
    \end{align}
\end{example}


\documentclass[12pt]{cdblatex}
\usepackage{fancyhdr}
\usepackage{footer}

\lstset{gobble=2}

\begin{document}

% =================================================================================================
% create checkpoint file

\bgroup
\CdbSetup{action=hide}
\begin{cadabra}
   import cdblib
   checkpoint_file = 'tests/semantic/output/geodesic-ivp.json'
   cdblib.create (checkpoint_file)
   checkpoint = []
\end{cadabra}
\egroup

% =================================================================================================
\section*{Geodesic IVP}

Our game here is to find the solution of
\begin{align*}
   0 = \frac{d^2 x^{a}}{ds^2} + \Gamma^{a}_{bc}(x) \frac{dx^b}{ds} \frac{dx^c}{ds}
\end{align*}
subject to the initial conditions $x^{a}(s) = x^a$ and $dx^a(s)/ds={\Dot x}^{a}$ at $s=0$.

% =================================================================================================
\section*{Algorithm}

By successive differentiation of the above equation we can compute
\begin{align*}
   \frac{d^n x^{a}}{ds^n} = -\Gamma^{a}_{\udn}\frac{dx^{\udn}}{ds}
\end{align*}
at $s=0$ for $n=2,3,4,\dotsc$. The $\Gamma^{a}_{\udn}$ are the \emph{generalised connections}.

We can then construct the Taylor series solution for $x^{a}(s)$
\begin{align*}
   x^a(s) = x^a + s {\Dot x}^a - \sum_{k=2}^\infty\>\frac{s^{k}}{k!} \Gamma^{a}_{\udk}{\Dot x}^{\udk}
\end{align*}

\clearpage

\begin{cadabra}
   {a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w#}::Indices(position=independent).

   \nabla{#}::Derivative.

   import cdblib

   # change signs to account for - sign in front of the sum for x^a(s), see above preamble

   def flip_sign (obj):
       return Ex(0) - obj

   sterm21 = flip_sign (cdblib.get ('genGamma01','genGamma.json'))
   sterm22 = flip_sign (cdblib.get ('genGamma02','genGamma.json'))
   sterm23 = flip_sign (cdblib.get ('genGamma03','genGamma.json'))
   sterm24 = flip_sign (cdblib.get ('genGamma04','genGamma.json'))

   sterm31 = flip_sign (cdblib.get ('genGamma11','genGamma.json'))
   sterm32 = flip_sign (cdblib.get ('genGamma12','genGamma.json'))
   sterm33 = flip_sign (cdblib.get ('genGamma13','genGamma.json'))

   sterm41 = flip_sign (cdblib.get ('genGamma21','genGamma.json'))
   sterm42 = flip_sign (cdblib.get ('genGamma22','genGamma.json'))

   sterm51 = flip_sign (cdblib.get ('genGamma31','genGamma.json'))

   sterm2 := @(sterm21) + @(sterm22) + @(sterm23) + @(sterm24).  # cdb (sterm2.000,sterm2)
   sterm3 := @(sterm31) + @(sterm32) + @(sterm33).               # cdb (sterm3.000,sterm3)
   sterm4 := @(sterm41) + @(sterm42).                            # cdb (sterm4.000,sterm4)
   sterm5 := @(sterm51).                                         # cdb (sterm5.000,sterm5)

   factor_out (sterm2,$A^{a?}$)                                  # cdb (sterm2.001,sterm2)
   factor_out (sterm3,$A^{a?}$)                                  # cdb (sterm3.001,sterm3)
   factor_out (sterm4,$A^{a?}$)                                  # cdb (sterm4.001,sterm4)
   factor_out (sterm5,$A^{a?}$)                                  # cdb (sterm5.001,sterm5)

   sterm2 := 360 @(sterm2).
   sterm3 := 360 @(sterm3).
   sterm4 :=  90 @(sterm4).
   sterm5 :=   3 @(sterm5).

   substitute (sterm2,$A^{a}->1$)                                # cdb (sterm2.002,sterm2)
   substitute (sterm3,$A^{a}->1$)                                # cdb (sterm3.002,sterm3)
   substitute (sterm4,$A^{a}->1$)                                # cdb (sterm4.002,sterm4)
   substitute (sterm5,$A^{a}->1$)                                # cdb (sterm5.002,sterm5)

\end{cadabra}

% =================================================================================================
% the remaining code is just for pretty printing

\clearpage

% =================================================================================================
\section*{The geodesic ivp}

\begin{align*}
   x^{a}(s) = x^{a}
            + s {\dot{x}^a}
            + \frac{s^2}{2!} {\dot{x}^b} {\dot{x}^c} A^{a}_{bc}
            + \frac{s^3}{3!} {\dot{x}^b} {\dot{x}^c} {\dot{x}^d} A^{a}_{bcd}
            + \frac{s^4}{4!} {\dot{x}^b} {\dot{x}^c} {\dot{x}^d} {\dot{x}^e} A^{a}_{bcde}
            + \frac{s^5}{5!} {\dot{x}^b} {\dot{x}^c} {\dot{x}^d} {\dot{x}^e} {\dot{x}^f} A^{a}_{bcdef}
            + \dotsb
\end{align*}
\begin{dgroup*}
   \begin{dmath*} 360 A^{a}_{bc} = \cdb{sterm2.002} \end{dmath*}
   \begin{dmath*} 360 A^{a}_{bcd} = \cdb{sterm3.002} \end{dmath*}
   \begin{dmath*}  90 A^{a}_{bcde} = \cdb{sterm4.002} \end{dmath*}
   \begin{dmath*}   3 A^{a}_{bcdef} = \cdb{sterm5.002} \end{dmath*}
\end{dgroup*}

\clearpage

% =================================================================================================
% export selected objects, these will later be imported into a library
% these are the objects that will appear in the paper

\begin{cadabra}
   sterm2short := @(sterm21) + @(sterm22).             # cdb (sterm2.short.001,sterm2short)
   sterm3short := @(sterm31).                          # cdb (sterm3.short.001,sterm3short)
   sterm2shortscaled := 12 @(sterm2short).             # cdb (sterm2.short.scaled.002,sterm2shortscaled)
   sterm3shortscaled :=  2 @(sterm3short).             # cdb (sterm3.short.scaled.002,sterm3shortscaled)

   substitute (sterm2shortscaled,$A^{a}->1$)           # cdb (sterm2.short.scaled.003,sterm2shortscaled)
   substitute (sterm3shortscaled,$A^{a}->1$)           # cdb (sterm3.short.scaled.003,sterm3shortscaled)

   cdblib.create ('geodesic-ivp.export')

   # 4th order ivp terms scaled
   cdblib.put ('ivp42',sterm2shortscaled,'geodesic-ivp.export')
   cdblib.put ('ivp43',sterm3shortscaled,'geodesic-ivp.export')

   # 6th order ivp terms scaled
   cdblib.put ('ivp62',sterm2,'geodesic-ivp.export')
   cdblib.put ('ivp63',sterm3,'geodesic-ivp.export')
   cdblib.put ('ivp64',sterm4,'geodesic-ivp.export')
   cdblib.put ('ivp65',sterm5,'geodesic-ivp.export')

   checkpoint.append (sterm2shortscaled)
   checkpoint.append (sterm3shortscaled)

   checkpoint.append (sterm2)
   checkpoint.append (sterm3)
   checkpoint.append (sterm4)
   checkpoint.append (sterm5)
\end{cadabra}

% just to check that we are exporting the correct 4th order terms

\begin{dgroup*}
   \begin{dmath*} \cdb*{sterm2.short.001} \end{dmath*}
   \begin{dmath*} \cdb*{sterm3.short.001} \end{dmath*}
   \begin{dmath*} \cdb*{sterm2.short.scaled.002} \end{dmath*}
   \begin{dmath*} \cdb*{sterm3.short.scaled.002} \end{dmath*}
   \begin{dmath*} \cdb*{sterm2.short.scaled.003} \end{dmath*}
   \begin{dmath*} \cdb*{sterm3.short.scaled.003} \end{dmath*}
\end{dgroup*}

% =================================================================================================
% export checkpoints in json format

\bgroup
\CdbSetup{action=hide}
\begin{cadabra}
   for i in range( len(checkpoint) ):
      cdblib.put ('check{:03d}'.format(i),checkpoint[i],checkpoint_file)
\end{cadabra}
\egroup

\end{document}


% !TEX root = altosaar-2020-thesis.tex
\chapter{Discussion}
\label{ch:discussion}
\lettrine[image=true,lines=3]{design/P}{robabilistic} modeling is useful across scientific domains. However, probabilistic modeling methods that do not take into account the structure of a problem, the form of individual datapoints, or information about probability distributions during optimization leave performance gains on the table.

As a motivating example, we built the structure of a statistical physics model into a probabilistic modeling method with \acrlongpl{hvm}. Efficient use of the connectivity patterns in physics models enabled scaling variational approximations to models with millions of random variables.

There is also utility in constructing probabilistic models with knowledge about individual datapoints. \acrlong{rfs} outperforms competitive recommendation models that either fail to take into account the goals of recommendation or the structure of items with sets of attributes.

We also improved variational inference, by making use of information about probability distributions within the \acrlong{PVI} algorithm. This enabled accurate inferences about probability distributions.

To further unify the thesis of problem structure as utile in probabilistic modeling, we test \acrlong{PVI} to measure whether the benefits of leveraging knowledge about a probability distributions are additive to performance gains from developing applied methods.

\input{table/tab_pvi_hvm}
Consider an Ising model studied in \Cref{ch:hvm}, where the goal is accurate inference of the free energy. \Cref{tab:pvi-hvm} shows a comparison between \gls{vi} and \gls{PVI} in an \gls{hvm}. This is a result of testing the best-performing settings from \Cref{ch:pvi} with the entropy constraint on both the variational prior and recursive variational approximation in an \gls{hvm}. The additional information \gls{PVI} makes available to the variational approximation during optimization leads to more accurate inference of the free energy.

Further, \gls{PVI} can be applied to probability models fit with maximum likelihood estimation. \Cref{tab:pvi-rfs} reports the performance of a \gls{rfs} model from \Cref{sec:rfs-experiments} fit to arXiv user behavior data. Fitting the recommendation model using the \gls{PVI} entropy proximity constraint improves top-10 recommendation recall. Metrics other than out-matrix recall (e.g. in-matrix recall) were comparable between these methods. With the \gls{PVI} entropy constraint, the recommendation performance of \gls{rfs} also improved in the meal recommendation task. \Cref{tab:pvi-rfs-meals} reports these results. The best-performing settings from \Cref{ch:pvi} generalize to maximum likelihood estimation in recommender systems, here giving a $6.9\%$ boost in top-$1$ recommender recall.

That \gls{PVI} yielded improvements when applied to both \glspl{hvm} applied to statistical physics problems and the \gls{rfs} recommendation model highlights several directions for further research. First, might \gls{PVI} yield further gains in accuracy when applied to statistical physics models with millions of random variables? Practitioners are willing to trade off diminished accuracy for scale in some cases, and \gls{PVI} is straightforward to test in new probability models and might help reduce the need for such trade-offs.
\input{table/tab_pvi_rfs}

Studying where \gls{PVI} yields marginal gains is also worth considering. For example, the entropy proximity constraint yielded less-significant improvements when applied to \gls{rfs} fit to the meal recommendation data in \Cref{sec:rfs-experiments}. This may be because the large size of data helped prevent overfitting, leading to reduced benefits of constraining parameter updates. In contrast, \glspl{hvm} fit to statistical physics models in \Cref{sec:hvm-experiments} converged to a solution very quickly, so monitoring convergence rates may be an additional source of information for proximity statistics.
\input{table/tab_pvi_rfs_meals}

While \Cref{ch:hvm} studied classical statistical physics models, future work in computational materials science and computational drug discovery will need to incorporate or approximate quantum effects. Density functional theory calculations based on quantum mechanics are expensive~\citep{schmidt2019recent} and limit the length of time that a material or drug binding to a protein can be simulated. Future work in this area should include study of the trade-off between the size of a system and the accuracy needed to study the behavior of a system to achieve a materials design or drug design goal. For example, suppose the behavior of a drug binding to a protein over the course of several seconds is of clinical interest. Then a practitioner might tolerate more inaccuracy in an \gls{hvm} approximation than they would if the short-run behavior could be accurately captured in a density functional theory calculation. One way of improving the trade-off may be to reduce the cost of fitting \glspl{hvm} by derive objective functions with better gradient signal-to-noise ratio~\citep{tucker2018doubly,rainforth2018tighter}. A similar trade-off occurs for system size, and it is unclear where \glspl{hvm} may provide the only way to model a large-scale physical system.

\Cref{ch:rfs} developed \gls{rfs}, and there remain several directions for future work on recommendation models for items with sets of attributes. Probabilistic generative models for use in recommendation may enable better recommendations under uncertainty, or easier incorporation of prior knowledge. However, probability distributions of sets of attributes are difficult to parameterize. One example of a distribution defined on sets is the Wallenius distribution~\citep{wallenius1963biased,junqu2000wallenius}. It is interesting to consider how a distribution on sets might be parameterized using a permutation-invariant model such as \gls{rfs}~\citep{bloem-reddy2019probabilistic,lee2018set-transformer}. Further, generalization bounds are necessary follow-up work to universal approximation properties. A model may be able to represent a distribution, but for practical purposes a key desideratum is finding functions, nonlinearities, and architectures that make optimization easy and generalization feasible~\citep{dziugaite2017computing}.

Another line of work is in developing robust negative sampling-based objective functions. The numeric value of the negative log-likelihood objective function used in \gls{rfs} or other models that use negative samples and embeddings cannot reliably assess convergence. This is due to embeddings that are used in both positive and negative examples, leading stochastic gradient updates to increase and decrease Monte Carlo estimates of the objective during optimization. Reliable methods to estimate the value of objective functions may help reduce the need for expensive recommender systems evaluation metrics where a model may need to be evaluated on every item in an evaluation set. While \gls{rfs} was designed for the recall evaluation metric, connecting binary classification objective functions with negative examples to ranking-based metrics such as normalized discounted cumulative gain would make these models useful broadly.

In \Cref{ch:rfs}, we found that \gls{rfs} outperforms \gls{lstm} recurrent neural networks in the task of recommending arXiv documents to users. This is counterintuitive, as the order of item attributes (words in abstracts) should carry significant information.  However, the computational budget was fixed for both models, and it is unclear which recommendation model to use with a large computational budget. Models such as transformers~\citep{vaswani2017attention,devlin2019bert:,lee2018set-transformer} might lead to improved recommendation performance, but at a greater computational cost than models such as \gls{rfs} with inner product parameterizations. Analyzing these trade-offs will help make informed choices of computational budget given performance requirements in practice. Under computational constraints due to monetary budget or privacy regulation, such as in clinical settings~\citep{huang2019clinicalbert:}, models such as \gls{rfs} that make fast, accurate, predictions may be preferable to more accurate, slower models.

Through careful consideration of how to build problem structure into probabilistic models, we were able to scale variational methods to statistical physics models with millions of random variables, fit recommender systems to tens of millions of datapoints, and improve the accuracy of variational inference. This highlights the need to ensure that progress in probabilistic modeling continues to be translated into progress in applied domains such as statistical physics and recommender systems.