The mathematical laws describing the deformation of a solid body are summarized in this section. First, the kinematic laws governing the motion of each material point belonging to a solid are considered. Then \textit{strain} measures are associated with internal forces through the thermodynamic framework so that \textit{constitutive equations} are derived. For a more exhaustive review of governing equations, see for instance \cite{Belytschko,Foundation_of_elasticity,Truesdell,Simo}.

\subsection{Kinematic laws -- Strain measures}
Consider a three-dimensional solid with volume denoted by $\Omega \subset \Rbb^3$ bounded by the surface $\partial \Omega$. This body undergoes external forces that can either be localized on a part of the external surface of the body (\textit{i.e. surface forces}) or act in the whole solid domain (\textit{i.e. volume forces}). Due to the presence of such loads, the domain may change within the time interval $\tau = \[0,T\]$ and is hence written as a function of time $\Omega(t)$ ($t\in \tau$). The state of the solid at time $t=0$, corresponding to a non-deformed state with volume $\Omega(t=0)=\Omega_0$, is referred to as the \textit{initial configuration}. Some problems require the use of a \textit{reference configuration} that can be deformed and to which equations are referred. In what follows, the reference and initial configurations are identical. At a given time $t>0$, the volume is $\Omega(t)=\Omega_t$ and the state of the solid corresponds to the \textit{current configuration}. These configurations are depicted in figure \ref{fig:deformationFunction}.
\begin{figure}[h]
  \centering
  \input{chapter2/pgfFigures/deformationFunction}
  \caption{Deformation of a solid body between a reference state $\Omega_0$ to a subsequent state $\Omega_t$.}
  \label{fig:deformationFunction}
\end{figure}
The points of $\Rbb^3$ are located with \textit{Eulerian} or \textit{spatial coordinates} $\vect{x}=x_i\vect{e}_i$ while material particles in the reference configuration are located with \textit{Lagrangian coordinates} $\vect{X}=X_\alpha \vect{E}_\alpha$.
%Two different bases $(\vect{E}_1,\vect{E}_2,\vect{E}_3)$ and $(\vect{e}_1,\vect{e}_2,\vect{e}_3)$, that may be different are not, allow the use of \textit{Lagrangian coordinates} and $\vect{E}_\alpha$ or \textit{Eulerian coordinates} $\vect{x}=x_i\vect{e}_i$ respectively. %Lagrangian coordinates give the location of material particles in the reference configuration while Eulerian coordinates are used to locate the point of space at which a particle may be at a given time.
%In the reference configuration, all material particles are located by their position vectors: $\vect{X}=X_\alpha \vect{E}_\alpha$.
At time $t$, the particle initially located at $\vect{X}$ may have moved to a different position given by the smooth mapping $\vect{\phi}(\vect{X},t)=\phi_i(\vect{X},t)\vect{e}_i$, providing the path of every particle of the solid during the deformation.
Thus, the current volume of the solid is defined by means of Eulerian coordinates and the \textit{deformation function} $\vect{\phi}(\vect{X},t)$ as: $\Omega(t)=\{\vect{x}\in \Rbb^3: \vect{x}=\vect{\phi}(\vect{X},t),\: \vect{X},t\in\Omega_0\times \tau\}$.
% The restriction of Eulerian coordinates to the current volume, namely $\vect{x}\in\Omega(t)$, allows to write the bijective relation $\vect{x}=\vect{\phi}(\vect{X},t)$.
%Thus, the mapping $\vect{\phi}$ provides the path of every particle of the solid during the deformation.
% In the Lagrangian coordinates system, particles are tracked during the deformation while the \textit{Eulerian coordinates}, denoted by $\vect{x}=x_i\vect{e}_i$, correspond to a \textit{spatial description}.
Note that in the above definitions Greek indices are used for quantities evaluated in the reference configuration whereas Latin ones refer to quantities defined in the current configuration.

The \textit{displacement} and \textit{velocity} vectors of a particle at time $t$ are respectively:
\begin{align}
    &\vect{u}(\vect{X},t)=\vect{\phi}(\vect{X},t) - \vect{X} \qquad \forall\:\: \vect{X},t \in \Omega_0\times \tau  \label{eq:displacement}\\
    &\vect{v}(\vect{X},t)=\drond{\vect{\phi}}{t}(\vect{X},t) = \vect{\dot{\phi}}(\vect{X},t) \qquad  \forall\: \: \vect{X},t \in \Omega_0\times \tau  \label{eq:velocity}
\end{align}
where the superposed dot denotes the material time derivative. The second-order two-point \textit{deformation gradient} tensor is defined as:
\begin{equation}
  \label{eq:F_phi}
    \tens{F}=\nablat_0 \vect{\phi} (\vect{X},t)
\end{equation}
where $\nablat_0 (\bullet)$ is the gradient operator in the reference configuration. This tensor can also be written by using equation \eqref{eq:displacement}:
\begin{equation}
  \tens{F}= \nablat_0 \vect{u}(\vect{X},t) + \tens{I} \label{eq:F_displacement}
\end{equation}
with $\tens{I}$, the second-order identity tensor. The deformation gradient tensor characterizes the variations of lengths, angles, areas and volumes. Indeed, the infinitesimal vector, oriented surface and volume elements in the reference configuration, respectively denoted by $\vect{dX},\vect{dS}$ and $dV$, transform respectively to:
\begin{equation}
  \label{eq:transport_equations}
  \begin{aligned}
    & dx_i=F_{i\alpha}dX_\alpha \\
    & ds_i=J F_{\alpha i}^{-1}dS_{\alpha} \\
    & dv=JdV
  \end{aligned}
\end{equation}
in the current configuration. Transport equations \eqref{eq:transport_equations} involve the determinant of the deformation gradient $J=\det(\tens{F})>0$, also called the \textit{Jacobian of the deformation}.

Since it accounts for changes in lengths and angles (\textit{i.e. the change of shape of a body}), the deformation gradient is one strain measure among others. For instance, one also defines the \textit{right Cauchy-Green} and the \textit{Green-Lagrange} tensors as:
\begin{equation*}
  \tens{C}=\tens{F}^T\tens{F} \quad ; \quad \tens{E}=\frac{1}{2}(\tens{C}-\tens{I})
\end{equation*}
respectively. Making use of equation \eqref{eq:F_displacement}, the Green-Lagrange tensor reads:
\begin{equation*}
  \tens{E}=\frac{1}{2}(\nablat_0 \vect{u} + \nablat_0 \vect{u}^T + \nablat_0 \vect{u}^T \nablat_0 \vect{u})
\end{equation*}
In particular, when a deformation involves displacement vectors such that $\norm{\nablat_0 \vect{u}} \ll 1$, the last term of the previous definition can be neglected, leading to:
\begin{equation}
  \label{eq:epsilon}
  \tens{E} \approx \frac{1}{2}(\nablat_0 \vect{u} + \nablat_0 \vect{u}^T) = \tens{\eps}
\end{equation}
with $\tens{\eps}$ the symmetric \textit{linearized strain tensor}. Such deformations fall in the \textit{small strains} framework and are characterized by small strains but possibly large displacements. Furthermore, when the deformation leads to a displacement vector $\frac{\norm{\vect{u}}}{L} \ll 1$, where $L$ is a characteristic length of the domain, reference and current configurations are considered as identical within equations of the Initial Boundary Value Problem (IBVP). The aforementioned situations correspond to the \textit{linearized geometrical} framework  or \textit{infinitesimal theory}.

\subsection{Balance equations}
% In this section a solid domain $\Omega(t)$ undergoing a deformation is still considered within the time interval $\tau = \[0,T\]$.
The time derivative of equations \eqref{eq:F_phi} and \eqref{eq:epsilon} combined with the definition of the velocity field \eqref{eq:velocity} yield respectively:
\begin{equation}
  \begin{aligned}
    & \tens{\dot{F}} - \nablat_0\vect{v} = \tens{0} \\
    & \tens{\dot{\eps}} - \nablat^s\vect{v} = \tens{0}
  \end{aligned} \label{eq:geometrical_conservation}
\end{equation}
where $\nablat^s(\bullet)$ denotes the symmetric gradient operator. By rewriting the gradient operators as:
\begin{align}
  & \nablat_0 \vect{v} = \nablav_0 \cdot \(\vect{v}\otimes\tens{I}\) \\
  & \nablat^s \vect{v} = \frac{1}{2}\nablav \cdot \(\vect{v}\otimes\tens{I}+\tens{I}\otimes \vect{v}\)
\end{align}
with $\nablav_0 \cdot \(\bullet\)$ and $\nablav \cdot\(\bullet\)$, the right divergence operators in reference and current configurations respectively. With these forms of gradient operators, geometrical relations \eqref{eq:geometrical_conservation} can be written as kinematic or geometrical balance laws \cite{Plohr,Haider_FVM,Gil_HE,Gil_SPH_HE}:
\begin{align}
  & \tens{\dot{F}} - \nablav_0 \cdot \(\vect{v}\otimes\tens{I}\) = \tens{0} \label{eq:HE_kinematic} \\
  & \tens{\dot{\eps}} - \frac{1}{2}\nablav \cdot \(\vect{v}\otimes\tens{I}+\tens{I}\otimes \vect{v}\) = \tens{0} \label{eq:HPP_kinematic}
\end{align}

Then, assuming that the mass of some amount of matter remains constant during the deformation, one writes the conservation of mass in integral form:
\begin{equation*}
  \int_\Omega \rho dv = \int_{\Omega_0} \rho_0 dV \qquad \forall \: t \in  \tau,\: \forall \:\Omega_0
\end{equation*}
which, with the third transport formula reads:
\begin{equation}
  \label{eq:mass_conservation_law}
  \int_{\Omega_0} \(J\rho - \rho_0\) dV = 0 \qquad \forall \:\Omega_0
\end{equation}
Since equation \eqref{eq:mass_conservation_law} holds regardless of the volume $\Omega_0$, the integrand must vanish so that the local conservation of mass is written:
\begin{equation}
  \label{eq:mass_balance}
  \rho\(\vect{\phi}(\vect{X},t),t\) = \frac{\rho_0\(\vect{X}\)}{J} \qquad \forall \: \vect{X},t \: \in \Omega_0\times \tau
\end{equation}

Furthermore, \textit{Newton's second law} states the equilibrium between inertia and external forces undergone by a solid $\Omega$. In the current configuration this conservation law consists of the \textit{translational} and \textit{rotational} balances, also known as \textit{linear momentum} and \textit{angular momentum} balance equations, which are respectively:
\begin{subequations}
  \begin{alignat}{1}
    \label{eq:linear_momentum}
    & \ddroit{}{t}\int_\Omega \rho \vect{v} dv = \int_{\partial \Omega} \vect{t} ds + \int_{\Omega} \rho\vect{b}dv \qquad \forall \: t \in  \tau,\: \forall \:\Omega  \\
    \label{eq:angular_momentum}
    & \ddroit{}{t}\int_\Omega \rho \vect{x} \times \vect{v} dv = \int_{\partial \Omega} \vect{x} \times\vect{t} ds + \int_{\Omega} \rho \vect{x} \times\vect{b}dv \qquad \forall \: t \in  \tau,\: \forall \:\Omega
  \end{alignat}
\end{subequations}
where $\vect{t}$ and $\vect{b}$ denote surface and volume forces and the cross operator denotes the vector product. The second-order \textit{Cauchy stress tensor} $\tens{\sigma}$ is then introduced by using Cauchy's theorem $\vect{t}=\tens{\sigma}\cdot \vect{n}$ where $\vect{n}$ is the outward normal vector to the surface element $ds$.

\begin{theorem}[Ostrogradski]
  The \textbf{divergence theorem} relates the flow of a quantity through a closed surface $\partial\Omega$ to the divergence of this quantity inside the volume $\Omega$ delimited by $\partial \Omega$:
\begin{equation}
  \label{eq:Ostrogradski_th}
  \int_{\partial \Omega} (\bullet)\cdot \vect{n}\:ds=\int_\Omega \nablav \cdot (\bullet) \: dv \qquad \forall\:\Omega
\end{equation}
\end{theorem}

% \begin{theorem}[Reynolds]
%   The \textbf{Reynolds transport theorem} relates the flow of a quantity through a closed surface $\partial\Omega$ to the divergence of this quantity inside the volume $\Omega$ delimited by $\partial \Omega$:
% \begin{equation}
%   \label{eq:Ostrogradski_th}
%   \int_{\partial \Omega} (\bullet)\cdot \vect{n}\:ds=\int_\Omega \nablav \cdot (\bullet) \: dv \qquad \forall\:\Omega
% \end{equation}
% \end{theorem}

\begin{definition}
  \label{def:Piola_transform}
  The Piola transform $\tens{T}^P$ of a second-order tensor $\tens{T}$ is defined as:
  \begin{equation*}
    \tens{T}^P=J\tens{T}\cdot\tens{F}^{-T}
  \end{equation*}
  and satisfies:
  \begin{equation*}
    \nablav_0\cdot \tens{T}^P = J \nablav \cdot \tens{T}
  \end{equation*}
\end{definition}

The conservation of linear momentum \eqref{eq:linear_momentum}, combined with the volume transport theorem \eqref{eq:transport_equations}, reads in the reference configuration:
\begin{equation}
  \label{eq:1}
    \ddroit{}{t}\int_{\Omega_0} \rho_0 \vect{v} \: dV = \int_{\Omega_0} J\nablav \cdot\tens{\sigma} \: dV + \int_{\Omega_0} \rho_0\vect{b}\:dV \qquad \forall \: t \in  \tau,\: \forall \:\Omega_0
\end{equation}
% Thus, by using the divergence theorem \eqref{eq:Ostrogradski_th} in the second law of Newton combined with the conservation of mass and the transport theorem, one gets:
% \begin{equation}
%   \label{eq:Linear_momentum_conservation_eulerian}
%   \int_{\Omega} \( \rho \vect{\dot{v}} - \nablav \cdot \tens{\sigma} -  \rho\vect{b} \) dV = \vect{0} \qquad \forall \:t \in  \tau,\: \forall \:\Omega
% \end{equation}
% The transport formula of volume elements \eqref{eq:transport_equations} are then combined to the mass balance equation \eqref{eq:mass_balance} in order to write the equation \eqref{eq:Linear_momentum_conservation_eulerian} in the reference configuration:
% \begin{equation}
%   \int_{\Omega_0} \( \rho_0 \vect{\dot{v}} - J \nablav \cdot \tens{\sigma} -  \rho_0\vect{b} \) dV = \vect{0} \qquad \forall \: t \in\tau,\: \forall \:\Omega_0
% \end{equation}
or, by using definition \ref{def:Piola_transform}:
\begin{equation}
  \label{eq:Linear_momentum_conservation}
  \int_{\Omega_0} \( \rho_0 \vect{\dot{v}} - \nablav_0 \cdot \tens{\Pi} -  \rho_0\vect{b} \) dV = \vect{0} \qquad \forall \: t \in\tau,\: \forall \:\Omega_0
\end{equation}
where the \textit{first Piola-Kirchhoff stress tensor} (PK1) $\tens{\Pi}=J\tens{\sigma}\cdot\tens{F}^{-T}$ is the Piola transform of Cauchy stress tensor. Thus, the vanishing of the integrand in equation \eqref{eq:Linear_momentum_conservation} yields the balance equation of the \textit{Lagrangian linear momentum}:
\begin{equation}
  \label{eq:Lagrangian_linear_momentum}
  \rho_0 \vect{\dot{v}} - \nablav_0 \cdot \tens{\Pi} = \rho_0 \vect{b} \qquad \forall \: \: \vect{X},t \in \Omega_0 \times \tau
\end{equation}
or equivalently for the current configuration:
\begin{equation}
  \label{eq:HPP_linear_momentum}
  \rho \vect{\dot{v}} - \nablav \cdot \tens{\sigma} = \rho \vect{b}  \qquad \forall \: \: \vect{x},t \in \Omega \times \tau
\end{equation}
On the other hand, the conservation of angular momentum \eqref{eq:angular_momentum} leads to the symmetry of Cauchy stress tensor $\tens{\sigma}=\tens{\sigma}^T$, or equivalently from the definition of PK1 tensor, $\tens{\Pi}\cdot \tens{F}^T=\tens{\Pi}^T\cdot \tens{F}$ \cite{Foundation_of_elasticity}.

We complete the set of balance laws by considering the \textit{first law of thermodynamics}. This law is a balance between the rates of change of \textit{kinetic} and \textit{internal} energies, the power of external forces, and the amount of heat entering the system as \textit{volume} or \textit{surface heat sources}.
\begin{equation*}
  \ddroit{}{t}\int_{\Omega} \(\frac{1}{2}\rho \vect{v}\cdot\vect{v} + \rho e\) dv = \int_{\partial \Omega} \(\tens{\sigma}\cdot\vect{n}\)\cdot\vect{v} \: ds + \int_{\Omega} \rho\vect{b}\cdot\vect{v} \: dv + \int_{\Omega} \rho r \:dv - \int_{\partial \Omega} \vect{q}\cdot\vect{n} \: ds \qquad \forall \: t \in  \tau ,\: \forall \:\Omega
\end{equation*}
where $\vect{q}$ is the outward heat flux vector, $r$ is a volume heat source and $e$ is the internal energy density. The divergence theorem \eqref{eq:Ostrogradski_th} yields:
\begin{equation*}
\ddroit{}{t}\int_{\Omega} \(\frac{1}{2}\rho \vect{v}\cdot\vect{v} + \rho e\) dv = \int_{\Omega} \(\nablav\cdot(\tens{\sigma}\cdot\vect{v}) +  \rho\vect{b}\cdot\vect{v} \) dv + \int_{\Omega} \rho r \: dv  - \int_{\partial \Omega} \vect{q}\cdot\vect{n} \: ds \qquad \forall \: t \in  \tau ,\: \forall \:\Omega
\end{equation*}
The transport of this relation in the reference configuration and introduction of the Lagrangian linear momentum \eqref{eq:Lagrangian_linear_momentum} and of kinetic conservation laws \eqref{eq:HE_kinematic} lead to:
\begin{equation}
  \label{eq:conservation_law_energy}
  \int_{\Omega_0} \rho_0 \dot{e} dV = \int_{\Omega_0} \tens{\Pi}:\tens{\dot{F}}\: dV + \int_{\Omega_0} \(\rho_0 r  - \nablav_0 \cdot \vect{Q}\) dV \qquad \forall \: t \in  \tau
\end{equation}
where $\vect{Q}=J\vect{q}\cdot \tens{F}^{-1}$ is the Lagrangian heat flux vector. One thus deduces the balance equation of internal energy in the reference configuration:
\begin{equation}
  \label{eq:energy_balance}
  \rho_0 \dot{e} -  \tens{\Pi}:\tens{\dot{F}}  + \nablav_0 \cdot \vect{Q}  = \rho_0 r \qquad \forall \: \: \vect{X},t \in \Omega_0 \times \tau
\end{equation}
Finally, the small strain version of equation \eqref{eq:energy_balance} is:
\begin{equation}
  \label{eq:energy_balance_euler}
  \rho \dot{e} -  \tens{\sigma}:\tens{\dot{\eps}}  + \nablav \cdot \vect{q}  = \rho r \qquad \forall \: \: \vect{x},t \in \Omega \times \tau
\end{equation}
Strain and stress are then conjugate fields through an energy function. The former are referred to as \textit{state variables} describing the evolution of the thermodynamic system while the latter are \textit{thermodynamic forces} governed by \textit{constitutive equations}. In what follows, such constitutive equations are derived.

\subsection{Constitutive equations -- Thermodynamics}
\label{sec:constitutive-equations}
The closure of the continuum equations is given by constitutive equations for the stress. Once and for all, we consider here constitutive models within the \textit{Generalized Standard Materials} (GSM) framework \cite{GSM}.

\subsubsection*{The general hyperelasticity formulation}
First, the \textit{Clausius-Duhem} inequality resulting from combination of first and second laws of thermodynamics, reads:
\begin{equation}
  \label{eq:Clausius-Duhem}
  \underbrace{\phantom{\frac{1}{\theta}} \tens{\Pi}:\tens{\dot{F}} + \rho_0 \(\theta \dot{\eta} -\dot{e}\)}_{\Dscr^{int}} \:  \underbrace{-\:\frac{1}{\theta} \vect{q} \cdot \nablav_0 \theta}_{\Dscr^{th}} \geq 0  \qquad \forall \: \: \vect{X},t \in \Omega_0 \times \tau
\end{equation}
where $\theta$ and $\eta$ denote the temperature and the entropy, and $\Dscr^{int}$ and $\Dscr^{th}$ are respectively the mechanical and thermal dissipations. The relation \eqref{eq:Clausius-Duhem} becomes an equality for \textit{reversible} processes and a strict inequality for \textit{irreversible} ones. Furthermore, a widely used assumption consists in considering that mechanical and thermal dissipations simultaneously satisfy non-negativeness.
Note that the \textit{Fourier's law} of conduction is based on the non-negativeness of the thermal dissipation and leads to the following definition of the heat flux vector in order to ensure the positiveness of the thermal dissipation:
\begin{equation*}
  \label{eq:Fourier_law}
  \vect{q}=-\tens{k}\cdot\nablav_0 \theta
\end{equation*}
where $\tens{k}$ is a positive-definite second-order tensor.

We assume that the internal energy density is a function of strain, entropy and additional internal variables $\Vc_p \: (1\leq p \leq N)$, describing irreversible processes. The Helmholtz free energy density on the other hand, defined as the \textit{Legendre transform} of internal energy, is a function of temperature and not of entropy: $\psi\(\tens{F},\theta,\Vcb\)=e\(\tens{F},\eta,\Vcb\)-\theta \eta$. The free energy density is supposed \textit{objective} or \textit{frame indifferent} \cite[p.255]{Simo}, concave with respect to temperature and convex with respect to other variables. The mechanical dissipation thus reads:
\begin{equation*}
  \Dscr^{int} = \tens{\Pi}:\tens{\dot{F}} - \rho_0 \(\dot{\psi} +\eta \dot{\theta}\)
\end{equation*}
or, by introducing the time derivative of the Helmholtz free energy density $\dot{\psi} = \drond{\psi}{\tens{F}}:\tens{\dot{F}} + \drond{\psi}{\theta}\dot{\theta} + \drond{\psi}{\Vcb}\dot{\Vcb}$
\begin{equation}
  \label{eq:Dint_psi_factor}
  \Dscr^{int} = \(\tens{\Pi}- \rho_0 \drond{\psi}{\tens{F}} \):\tens{\dot{F}} - \rho_0 \(\drond{\psi}{\theta} +\eta\) \dot{\theta}  - \rho_0\drond{\psi}{\Vcb}\dot{\Vcb}
\end{equation}

Since the mechanical dissipation must be non-negative regardless of the nature of the transformation, it must in particular vanish for a reversible isothermal process (\textit{i.e. $\theta=const$}) for which every additional internal variable is constant (\textit{i.e. $\dot{\Vc}=0$}). With these considerations, we are left with the relation:
\begin{equation*}
  \( \tens{\Pi} - \rho_0\drond{\psi}{\tens{F}} \): \tens{\dot{F}} = 0
\end{equation*}
holding regardless of the deformation, and hence:
\begin{equation}
  \label{eq:PK1_definition}
  \rho_0\drond{\psi}{\tens{F}} = \tens{\Pi}
\end{equation}
A material is said \textit{hyperelastic} if there exists a \textit{stored energy density function} $\rho_0\psi$ from which can be derived the first Piola-Kirchhoff stress tensor \cite[p.8]{Foundation_of_elasticity}.

Similar considerations lead to the state laws for entropy and are assumed for additional thermodynamic forces associated with internal variables $\Vcb$:
\begin{equation}
  \label{eq:thermodynamic_forces}
  \drond{\psi}{\theta} = - \eta \quad ; \quad \rho_0\drond{\psi}{\Vcb}=-\Acb
\end{equation}

\begin{remark}
  \label{rq:isothermal_deformation}
  Temperature has been introduced as a state variable and requires the first principle of thermodynamics, rewritten as the heat equation, in order to close the system:
  \begin{equation*}
    \rho_0 C \dot{\theta} = \rho_0 r - \nablav_0 \cdot \vect{Q} - \rho_0 \drond{\psi}{\Vcb}\dot{\Vcb} + \theta \(\drond{\tens{\Pi}}{\theta}:\tens{\dot{F}} - \drond{\Acb}{\theta}\dot{\Vcb} \)
  \end{equation*}
  Nevertheless, we will restrict our attention in the following to isothermal deformations so that temperature can be omitted and internal energy balance equations \eqref{eq:energy_balance} or \eqref{eq:energy_balance_euler} are not considered.
  % automatically satisfied. Indeed, for isothermal processes the heat equation leads to:
  % \begin{equation*}
  %   \rho_0 r - \nablav_0 \cdot \vect{Q} = \rho_0 \drond{\psi}{\Vcb}\dot{\Vcb}
  % \end{equation*}
  % which, once introduced in the energy balance \eqref{eq:energy_balance} yields:
  % \begin{equation*}
  %   \rho_0 \dot{e} - \tens{\Pi}:\tens{\dot{F}} = \rho_0 \drond{\psi}{\Vcb}\dot{\Vcb}
  % \end{equation*}
  % By using the time derivative of free energy density and noting that $\eta=-\drond{\psi}{\theta} =0$, we get that each side of the previous equation simplify.
\end{remark}

For isothermal reversible deformations in hyperelastic solids, the time derivative of equation \eqref{eq:PK1_definition} leads to:
\begin{equation}
  \label{eq:HE_tangent}
  \tens{\dot{\Pi}} = \rho_0\ddrond{\psi}{\tens{F}}{\tens{F}}:\tens{\dot{F}} = \Hbb:\tens{\dot{F}}
\end{equation}
where $\Hbb$ is the fourth-order \textit{tangent modulus} tensor (major symmetric).
%\subsubsection*{Examples of hyperelastic constitutive laws}
The above discussion is now specified to constitutive models that will be used in the remainder of the manuscript.
\begin{example}[Nearly incompressible Neo-Hookean]
The nearly incompressible neo-Hookean hyperelastic model is well-suited to describe rubber-like materials and is based on the polyconvex stored energy function (\textit{i.e. convex with respect to all its arguments}):
\begin{equation}
  \label{eq:neo-hook_energy}
  \rho_0 \psi(J,\tens{F})= \frac{\kappa}{2}(J-1)^2 + \frac{\mu}{2}\[J^{-2/3} (\tens{F}:\tens{F})-3 \]
\end{equation}
where $\kappa$ is the bulk modulus and $\mu$ the Lam\'e shear modulus. The first Piola-Kirchhoff stress and the acoustic tensor $A_{ij}=N_\alpha H_{i\alpha j\beta} N_\beta$ are for this model \cite{Haider_FVM}:
\begin{equation}
  \label{eq:PK1_neo-hook}
  \tens{\Pi} = \mu J^{-2/3} \[\tens{F}- \frac{1}{3}\(\tens{F}:\tens{F}\) \tens{F}^{-T}\] + \kappa \(J-1\)\tens{H}
\end{equation}
and
\begin{equation}
  \label{eq:neo-hook_acoustic}
  \begin{split}
      \tens{A}=\[\frac{5}{9}\mu J^{-8/3}\(\tens{F}:\tens{F}\)   + \kappa \]&(\tens{H}\cdot\vect{N})\otimes\(\tens{H}\cdot\vect{N} \)  + \mu J^{-2/3} \tens{I}  \\ &-\frac{2}{3}\mu J^{-5/3}\[(\tens{H}\cdot\vect{N})\otimes\(\tens{F}\cdot\vect{N} \)	+  (\tens{F}\cdot\vect{N})\otimes\(\tens{H}\cdot\vect{N} \)\]
  \end{split}
\end{equation}
where $\tens{H}=J\tens{F}^{-T}$ is the \textit{adjoint tensor} of the deformation gradient. The polyconvexity of this model ensures the positive definiteness of the acoustic tensor \eqref{eq:neo-hook_acoustic} \cite{Kluth}.
\end{example}

\begin{example}[Saint-Venant-Kirchhoff]
The Saint-Venant-Kirchhoff hyperelastic model is based on the stored energy function:
\begin{equation}
  \label{eq:SVK_energy}
  \rho_0\psi=\frac{1}{8}\(\tens{F}^T\tens{F}- \tens{I}\):\Cbb:\(\tens{F}^T\tens{F}- \tens{I}\)
\end{equation}
where $\Cbb$ is the fourth-order elasticity tensor defined as: $C_{i\alpha j\beta}= \lambda \delta_{i\alpha}\delta_{j\beta} + \mu \(\delta_{ij}\delta_{\alpha\beta}+\delta_{i\beta}\delta_{j\alpha}\)$, with Lamé parameters $(\lambda,\mu)$. By differentiating the stored energy function \eqref{eq:SVK_energy} with respect to the deformation gradient, the PK1 stress is:
\begin{equation}
  \label{eq:SVK_PK1}
  \tens{\Pi} = \frac{1}{2}\lambda \(\tens{F}:\tens{F}- 3\) \tens{F} + \mu\tens{F}\(\tens{F}^T\tens{F}- \tens{I}\)
\end{equation}
whose derivative with respect to $\tens{F}$ yields the tangent modulus:
\begin{equation}
  \label{eq:SVK_tangent}
  \Hbb = \lambda \[\tens{F}\otimes\tens{F} + \frac{1}{2} (\tens{F}:\tens{F}- 3)\Ibb\]+ \mu\(\Bbb- \Ibb \)
\end{equation}
with $B_{i\alpha j \beta}=F_{k\alpha}F_{k\beta}\delta_{ij} + F_{j\alpha}F_{i\beta} +F_{i\mu} F_{j\mu}\delta_{\alpha\beta}$ and the fourth order identity tensor $I_{i\alpha j \beta}=\delta_{ij}\delta_{\alpha \beta}$. The previous tangent modulus finally leads to the acoustic tensor:
\begin{equation}
  \label{eq:SVK_acoustic}
  \begin{split}
    \tens{A} = \lambda \[\vphantom{\frac{1}{2}} (\tens{F}\cdot\vect{N})\otimes(\tens{F}\cdot\vect{N}) \right.+ &\left.\frac{1}{2} (\tens{F}:\tens{F}- 3)\tens{I}\] \\
    + & \mu\[(\tens{F}\cdot\vect{N})\cdot(\tens{F}\cdot\vect{N})\tens{I} + (\tens{F}\cdot\vect{N})\otimes(\tens{F}\cdot\vect{N}) + \tens{F}\cdot\tens{F}^T- \tens{I} \]
  \end{split}
\end{equation}
Even though this model can lead to non-physical solutions, as we shall see in section \ref{sec:SVK_solution}, it will be used for a one-dimensional strain problem for it enables the development of an exact solution.
\end{example}

%\subsubsection*{History-dependent models in small strain}
\subsubsection*{The infinitesimal theory formulation}
%Analogously to the hyperelastic case, constitutive equations within the small strain framework are derived from the Eulerian Clausius-Duhem inequality. Then, by assuming the existence of a Helmholtz free energy density $\psi$ depending on the temperature $\theta$, the linearized strain tensor $\tens{\eps}$ and additional internal variables $\Vcb$,

The linearized geometrical framework leads, by assuming the existence of a Helmholtz free energy density $\psi$ that depends on the temperature $\theta$, the infinitesimal strain tensor $\tens{\eps}$ and additional internal variables $\Vcb$, to the following relation \cite[Ch.2]{Simo}:
\begin{equation}
  \label{eq:Cauchy_definition}
  \rho \drond{\psi}{\tens{\eps}} = \tens{\sigma}
\end{equation}
% which time derivative yields:
% \begin{equation}
%   \label{eq:HPP_tangent}
%   \tens{\dot{\sigma}} = \rho\ddrond{\psi}{\tens{\eps}}{\tens{\eps}}:\tens{\dot{\eps}} = \Cbb:\tens{\dot{\eps}}
% \end{equation}
The infinitesimal strain tensor is further assumed to be additively decomposed into an elastic and a plastic part: $\tens{\eps} = \tens{\eps}^e + \tens{\eps}^p$. Then, with irreversible deformations due to plastic strains, the mechanical dissipation reads:
\begin{equation}
  \label{eq:HPP_dissipation}
  \Dscr^{int}=\tens{\sigma}:\tens{\dot{\eps}}^p -\rho \drond{\psi}{\Vcb}\dot{\Vcb} \geq 0
\end{equation}

A \textit{yield condition} is defined by means of function $f(\tens{\sigma},\Acb)$ so that the elastic domain $\Ebb$ in forces space $(\tens{\sigma},\Acb)$ corresponds to:
\begin{equation}
  \label{eq:elastic_convex}
  \Ebb = \{ (\tens{\sigma},\Acb)\: | \: f(\tens{\sigma},\Acb) \leq 0\}
\end{equation}
According to the GSM framework \cite{GSM} we assume the existence of a dissipation pseudo-potential $\Phi(\tens{\sigma},\Vcb)$, convex with respect to thermodynamic forces and vanishing at the origin of the $(\tens{\sigma},\Vcb)$ space. This pseudo-potential enables the derivation of the plastic \textit{flow} and \textit{hardening} rules:
\begin{subequations}
  \begin{alignat}{2}
    \label{eq:flow_rule_plast}
     \tens{\dot{\eps}}^p&=&\drond{\Phi}{f}\drond{f}{\tens{\sigma}}\\
    \label{eq:hardening_rule_plast}
     \dot{\Vcb}& = -&\drond{\Phi}{f}\drond{f}{\Acb}
  \end{alignat}
\end{subequations}
where $\drond{\Phi}{f}=\dot{p}$ is the equivalent plastic strain rate.
An example of a model used for metals is the \textit{plastic $J_2$ flow theory} where the elastic domain is here described by a yield function that depends on the deviatoric part of the Cauchy stress, $\tens{s}=\tens{\sigma}-\frac{1}{3}\tr \tens{\sigma}\tens{I}$, through its second invariant $J_2(\tens{s})=\frac{1}{2}\tens{s}:\tens{s}$.
%The elastic domain is here described by a yield function that depends on the deviatoric part of the Cauchy stress, $\tens{s}=\tens{\sigma}-\frac{1}{3}\tr \tens{\sigma}\tens{I}$, through its second invariant $J_2(\tens{s})=\frac{1}{2}\tens{s}:\tens{s}$ according to the \textit{plastic $J_2$ flow theory} generally used to model metals.
In addition, a set of internal variables and associated forces describing the plastic hardening of the material is used $\{\Vcb,\Acb\}=\{\[\tens{\eps}^p,p\],\[\tens{s}-\tens{Y},-R(r)\]\}$ in order to define the \textit{von-Mises yield surface}:
\begin{equation}
  \label{eq:von-Mises_yield}
  f\(\tens{\sigma},\Acb \)= \sqrt{\frac{3}{2}}\norm{\tens{s}-\tens{Y}} - \(R(r)+\sigma^y\) \equiv 0
\end{equation}
where $\sigma^y$ is the tensile yield stress and $r$ is to be defined. In deviatoric stress space, the von-Mises yield surface is a circle whose center and radius are $\tens{Y}$ and $R(r)$. These thermodynamic forces hence respectively describe the displacement of the elastic domain center due to \textit{kinematic hardening}, and the evolution of its radius due to \textit{isotropic hardening}.
Setting $R(r)$ (\textit{resp.} $\tens{Y}$) to zero amounts to specializing the yield surface \eqref{eq:von-Mises_yield} to kinematic (\textit{resp. isotropic}) hardening.
%The specialization of the yield surface \eqref{eq:von-Mises_yield} to kinematic or isotropic hardenings is made by respectively setting $R(r)=0$ or $\tens{Y}=\tens{0}$.
% In the following, linear hardening will be considered here by setting either $\tens{Y}=\tens{0}$ for isotropic or $R(r)=0$ for kinematic hardening.
Then, flow rules \eqref{eq:flow_rule_plast} and \eqref{eq:hardening_rule_plast} applied to the yield function \eqref{eq:von-Mises_yield} lead to:
\begin{subequations}
  \begin{alignat}{1}
    \label{eq:plastic_strain_rate}
    &\tens{\dot{\eps}}^p=\dot{p}\sqrt{\frac{3}{2}}\frac{\tens{s}-\tens{Y}}{\norm{\tens{s}-\tens{Y}}}=\dot{p}\:\sqrt{\frac{3}{2}}\tens{m} \\
    \label{eq:equiv_plastic_strain_rate}
    &\dot{r}=\dot{p}
  \end{alignat}
\end{subequations}
where $r$ is identified from \eqref{eq:equiv_plastic_strain_rate} as the equivalent plastic strain and $\tens{m}$ is referred to as the \textit{plastic flow direction}.

Next, assuming a Prager-Ziegler linear kinematic hardening \cite[p.91]{Simo}, the Helmholtz free energy density takes the form:
%By considering internal variables and associated forces as: $\{\Vcb,\Acb\}=\{\[\tens{\eps}^p,p\],\[\tens{s}-\tens{Y},-R(p)\]\}$, one defines the following Helmholtz free energy density:
\begin{equation}
  \label{eq:EP_helmoltz}
  \rho \psi = \frac{1}{2}\tens{\eps}^e:\Cbb:\tens{\eps}^e + \frac{2}{3}C\tens{\eps}^p:\tens{\eps}^p + H(p)
\end{equation}
where $H(p)$ is defined so that $H''(p)=C$ is the \textit{hardening modulus}, and $\Cbb$ is the fourth-order \textit{elastic stiffness} tensor (major and minor symmetric) defined for isotropic materials as $C_{ijkl}=\lambda \delta_{ij}\delta_{kl} + \mu \(\delta_{ik}\delta_{jl}+\delta_{il}\delta_{jk}\)$.
Thermodynamic forces are finally related to internal variables by means of equation \eqref{eq:thermodynamic_forces}, that is:
\begin{subequations}
  \begin{alignat}{1}
    \label{eq:eta}
    \tens{Y}&=\frac{2}{3}C\tens{\eps}^p \\
    \label{eq:isotropic_hardening}
    R &=H'(p)
  \end{alignat}
\end{subequations}

We consider in what follows isothermal deformations of isotropic solids, that may be irreversible by specifying the above developments to some well-known small strain constitutive models.
\begin{example}[Linear elasticity]
  The simplest case that is considered hereinafter does not involve irreversible deformations, and hence additional internal variables (\textit{i.e. $\tens{\eps}^p\equiv \tens{0}$}), and is referred to as linear elasticity. The combination of equations \eqref{eq:Cauchy_definition} and \eqref{eq:EP_helmoltz} then leads to \textit{Hooke's law}:
  \begin{equation}
    \label{eq:Hooke}
    \tens{\sigma}=\Cbb:\tens{\eps}
  \end{equation}
  or in rate form:
  \begin{equation}
    \label{eq:elastic_law}
    \tens{\dot{\sigma}}=\Cbb:\tens{\dot{\eps}}
  \end{equation}
  The elastic acoustic tensor is further defined as:
  \begin{equation}
    \label{eq:elasticity_acoustic}
    A^{\text{elast}}_{ij}= n_k C_{kijl}n_l= \lambda n_in_j + \mu \(n_in_j + \delta_{ij}\)
  \end{equation}
\end{example}

\begin{example}[Elastoplasticity]
  Rate-independent plasticity or elastoplasticity is based on the assumption that admissible thermodynamic forces lie within or on the boundary of the elastic domain \eqref{eq:elastic_convex}. The equivalent plastic strain rate becomes a Lagrange multiplier in order to ensure $f(\tens{\sigma},\Acb)\leq 0$ and must obey the \textit{K{\"u}hn-Tucker compatibility conditions}:
\begin{equation}
  \label{eq:Kuhn_Tucker}
  \dot{p} \geq 0 \quad ; \quad f \leq 0 \quad ; \quad \dot{p}f =0
\end{equation}
The equivalent plastic strain rate, is determined by the \textit{consistency condition} $\dot{f}=\drond{f}{(\tens{s}-\tens{Y})}:(\tens{\dot{s}}-\tens{\dot{Y}}) - \drond{f}{R}\dot{R}=0$ that leads to:
\begin{equation}
   \sqrt{\frac{3}{2}}\tens{m}:\dot{\tens{Y}} + \dot{R} =\sqrt{\frac{3}{2}}\tens{m}:\dot{\tens{\sigma}}
\end{equation}
Then, combination of the above equation with the elastic law $\tens{\dot{\sigma}}=\Cbb:\(\tens{\dot{\eps}}-\tens{\dot{\eps}}^p\)$ and equation \eqref{eq:plastic_strain_rate} yields:
\begin{equation}
  \label{eq:p_evolution}
  \dot{p}=\sqrt{\frac{3}{2}}\frac{2\mu}{3\mu+(C+R')}\tens{m}:\tens{\dot{\eps}}=\sqrt{\frac{3}{2}}\frac{2\mu}{3\mu+(C+R')}\tens{m}:\tens{\dot{\eps}}
\end{equation}
At last, equations \eqref{eq:plastic_strain_rate} and \eqref{eq:p_evolution} can be successively introduced in the elastic law so that one gets \cite[eq (2.2.22)]{Simo}:
\begin{equation}
  \label{eq:elastoplastic_tangent}
  \tens{\dot{\sigma}}=\(\Cbb - \frac{6\mu^2}{3\mu +(C+R')}\tens{m}\otimes\tens{m} \):\tens{\dot{\eps}} = \Cbb^{ep}:\tens{\dot{\eps}}
\end{equation}
with $\Cbb^{ep}$ the \textit{elastoplastic tangent modulus}.
The \textit{elastoplastic acoustic tensor} is defined as:
\begin{equation}
  \label{eq:EP_acoustic}
  A_{ij}^{ep}= n_k C^{ep}_{ikjl}n_l = A_{ij}^{elast} -  \frac{6\mu^2}{3\mu +(C+R')} (n_k m_{ik})(m_{jl}n_l)
\end{equation}
which is positive-definite for positive linear hardening ($C>0 \:;\: R'>0$).
\end{example}

\begin{example}[Elasto-viscoplasticity]
  Viscoplasticity or rate-dependent plasticity can be seen as a regularization of rate-independent plasticity that relaxes the condition $f(\tens{\sigma},\Acb)\leq 0$ and thus leads to admissible thermodynamic forces lying outside the elastic domain \cite[p.58]{Simo}.
  %%
  Viscoplasticity provides on the other hand an explicit definition of the equivalent plastic strain, for example the Perzyna or Sokolowskii-Malvern model \cite{Perzyna} is governed by:
  \begin{equation}
    \label{eq:EVP_creep_law}
    \dot{p}=\left\langle \frac{f}{\gamma}\right\rangle^n
  \end{equation}
  where $\left\langle\bullet\right\rangle=\frac{\bullet + \abs{\bullet}}{2}$ is the positive part function, and $n$ and $\gamma$ are parameters. % arising from the relaxation of the condition $f\leq 0$.
  %%
  Hence, the plastic fluxes $\tens{\dot{\eps}}^p, \dot{\Vcb}$ are completely determined by \eqref{eq:flow_rule_plast} and \eqref{eq:hardening_rule_plast}.
  %%
  It then comes out that rate-dependent plasticity is driven by the elastic law:
  \begin{equation}
    %\label{eq:elastic_law}
    \tens{\dot{\sigma}}=\Cbb:\(\tens{\dot{\eps}}-\tens{\dot{\eps}}^p\)
  \end{equation}
  in which $\tens{\dot{\eps}^p}$ is given by the combination of equations \eqref{eq:flow_rule_plast} and \eqref{eq:EVP_creep_law}, namely:
  \begin{equation}
    \label{eq:EVP_plastic_strain_rate}
    \tens{\dot{\eps}}^p=\left\langle \frac{f}{\gamma}\right\rangle^n\:\sqrt{\frac{3}{2}}\tens{m}
  \end{equation}
\end{example}

\subsection{The general formulation}
\label{sec:general-formulation}
Balance and constitutive equations obtained previously are now summarized for various classes of materials and regimes of deformation. Recall that the deformations are assumed isothermal and that history effects are considered within the infinitesimal theory only.

\subsubsection*{Hyperelasticity}
%The non-linear constitutive equations of elastoplasticity and hyperelasticity prevent the writing of a conservative form with the previous approach.
The system of conservation laws for problems involving hyperelastic solids is composed of kinematic laws \eqref{eq:HE_kinematic} and the balance equation of Lagrangian linear momentum \eqref{eq:Lagrangian_linear_momentum}, repeated here for convenience:
\begin{align}
  & \tens{\dot{F}} - \nablav_0 \cdot \(\vect{v}\otimes\tens{I}\) = \tens{0}\\
  & \rho_0 \vect{\dot{v}} - \nablav_0 \cdot \tens{\Pi} = \rho_0 \vect{b}
\end{align}
Assuming a Cartesian coordinate system, this system can be written in \textit{conservative form}:
\begin{equation}
  \label{eq:general_conservative_HE}
  \Ucb_t + \sum_{\alpha=1}^D \drond{\Fcb\cdot \vect{E}_\alpha}{X_\alpha} = \Scb
\end{equation}
where the vector of conserved quantities $\Ucb$, flux vectors $\Fcb\cdot \vect{E}_\alpha$ and the source term $\Scb$ are:
\begin{equation}
  \label{eq:vectors_hyperelasticity}
  \Ucb =\matrice{\rho_0\vect{v} \\ \tens{F}} \quad ; \quad \Fcb\cdot\vect{E}_\alpha = \matrice{-\tens{\Pi}\cdot\vect{E}_\alpha\\-\vect{v}\otimes\vect{E}_\alpha } \quad; \quad \Scb = \matrice{ \rho_0\vect{b} \\ \tens{0}}
\end{equation}
A quasi-linear system may then be built by introducing an auxiliary vector $\Qcb=\matrice{\vect{v}\\ \tens{\Pi}}$ and using the chain rule according to \cite{Trangenstein91}:
\begin{equation}
  \label{eq:quasi-linear_Trangenstein}
  \drond{\Qcb}{t} + \(\drond{\Ucb}{\Qcb}\)^{-1}\drond{\Fcb\cdot\vect{E}_\alpha}{\Qcb} \drond{\Qcb}{X_\alpha} = \(\drond{\Ucb}{\Qcb}\)^{-1}\Scb = \tilde{\Scb}
\end{equation}
In the quasi-linear form, the derivative of the vector of conserved quantities with respect to the auxiliary vector leads to the diagonal matrices:
\begin{equation*}
  \drond{\Ucb}{\Qcb}=\matrice{\tens{I} & \tens{0}^3 \\ \tens{0}^3  & \drond{\tens{F}}{\tens{\Pi}}} \Rightarrow \(\drond{\Ucb}{\Qcb}\)^{-1}=\matrice{\tens{I} & \tens{0}^3 \\ \tens{0}^3  & \drond{\tens{\Pi}}{\tens{F}}}
\end{equation*}
where the tangent modulus $\drond{\tens{\Pi}}{\tens{F}}=\Hbb$ arises and $\tens{0}^p$ is a $p$th-order zero tensor. Moreover, the derivative of the flux vectors with respect to the auxiliary vector reads:
\begin{equation}
  \drond{\Fcb\cdot\vect{E}_\alpha}{\Qcb}=-\matrice{\tens{0}^2 & \frac{1}{\rho_0}\tens{I}\otimes\vect{E}_\alpha \\    \tens{I}\boxtimes \vect{E}_\alpha & \tens{0}^4}
\end{equation}
in which the operator $\tens{I}\boxtimes\vect{E}_\alpha$ is the transpose on second and third indices of the classical tensor product, namely: $\tens{I}\boxtimes\vect{E}_\alpha=\delta_{jk} \vect{e}_j\otimes \vect{E}_\alpha\otimes\vect{e}_k$.
Finally, the quasi-linear form associated with hyperelastic problems is:
\begin{equation}
  \Qcb_t + \Absf^\alpha \drond{\Qcb}{X_\alpha} = \Scb \qquad \text{with: }\Absf^\alpha = -\matrice{ \tens{0}^2 & \frac{1}{\rho_0}\tens{I}\otimes\vect{E}_\alpha \\ \Hbb\cdot\vect{E}_\alpha & \tens{0}^4} \label{eq:HE_quasilinear}
\end{equation}
where the dependence on $\Qcb$ of matrices $\Absf^\alpha(\Qcb)$ has been omitted for simplicity.

\subsubsection*{Linear elasticity and elasto-viscoplasticity}
The governing equations of elasticity and elasto-viscoplasticity within the linearized geometrical framework consist of the kinematic law \eqref{eq:HPP_kinematic}, the balance equation of linear momentum \eqref{eq:HPP_linear_momentum} and the elastic law \eqref{eq:elastic_law}:
\begin{align*}
  & \tens{\dot{\eps}}-\nablav \cdot \(\frac{\vect{v}\otimes\tens{I}+\tens{I}\otimes \vect{v}}{2}\) =\tens{0} \\
  & \rho \vect{\dot{v}} - \nablav \cdot \tens{\sigma} = \rho \vect{b} \\
  & \tens{\dot{\sigma}} - \Cbb :\(\tens{\dot{\eps}}-\tens{\dot{\eps}}^p\) =\tens{0}
\end{align*}
Combining kinematic and elastic laws and considering again a Cartesian coordinates system yields, for a homogeneous media (\textit{i.e. $\nablav \rho=\vect{0}$}), the following \textit{conservative form}:
%Hence, introduction of kinematic laws in the elastic law yields, by assuming a Cartesian coordinates system and homogeneous media (\textit{i.e. $\nablav \rho=\vect{0}$}), the following \textit{conservative form}:
\begin{equation}
  \label{eq:general_conservative}
  \Qcb_t + \sum_{i=1}^D \drond{\Fcb\cdot \vect{e}_i}{x_i} = \Scb
\end{equation}
with conserved quantities, flux and source term vectors respectively defined as:
\begin{equation}
  \label{eq:vectors_elasticity}
  \Qcb =\matrice{\vect{v} \\ \tens{\sigma}} \quad ; \quad \Fcb\cdot\vect{e}_i = \matrice{-\frac{1}{\rho}\tens{\sigma}\cdot\vect{e}_i\\-\Cbb:\frac{\vect{v}\otimes\vect{e}_i +\vect{e}_i \otimes\vect{v} }{2} } \quad ; \quad \Scb = \matrice{ \vect{b} \\ -\Cbb:\tens{\dot{\eps}}^p}
\end{equation}
Note that here, the direct writing of the conservative form in terms of $\vect{v}$ and $\tens{\sigma}$ is made possible by the linearity of the elasticity tensor, avoiding thus the introduction of an auxiliary vector. The quasi-linear form of equation \eqref{eq:general_conservative} is derived by means of the chain rule:
\begin{equation}
  \label{eq:HPP_quasi-linear}
  \Qcb_t + \Absf^i \drond{\Qcb}{x_i} = \Scb
\end{equation}
where:
\begin{equation*}
  \Absf^i=\drond{\Fcb\cdot \vect{e}_i}{\Qcb}=-\matrice{\tens{0}^3 & \frac{1}{\rho}\tens{I}\otimes\vect{e}_i\\\Cbb\cdot\vect{e}_i & \tens{0}^4}
\end{equation*}
in which symmetries of the elastic stiffness tensor have been used. Since the elastic stiffness tensor is constant, system \eqref{eq:HPP_quasi-linear} is linear for elasticity and semi or non-linear for elasto-viscoplasticity depending on the flow rule \eqref{eq:flow_rule_plast}. Moreover, the source term arising due to the viscoplastic flow rule \eqref{eq:EVP_plastic_strain_rate} can be written in terms of a relaxation term $\bar{\Scb}$ and a relaxation time $\tau=(\gamma/\sigma^y)^n$ as $\Scb=\bar{\Scb}/\tau$ \cite{Thomas_EVP}, so that the system \eqref{eq:HPP_quasi-linear} can be identified to a \textit{relaxation system} \cite{Relaxation_syst}. In the asymptotic limit $\tau \rightarrow 0$ or in the \textit{vanishing viscosity limit}, system \eqref{eq:HPP_quasi-linear} tends to the \textit{equilibrium system} corresponding to elastoplasticity \cite{Thomas_EVP}.

\subsubsection*{Elastoplasticity}
The writing of a conservative form for elastoplasticity is similar to what was done for hyperelastic solids. Indeed, the system composed of kinematic laws \eqref{eq:HPP_kinematic} and the balance equation of linear momentum \eqref{eq:HPP_linear_momentum}:
%The system of conservation laws for non-linear problems are based on kinematic laws \eqref{eq:HPP_kinematic} so that a conservative form \eqref{eq:general_conservative} is also written:
\begin{align*}
  & \tens{\dot{\eps}}-\nablav \cdot \(\frac{\vect{v}\otimes\tens{I}+\tens{I}\otimes \vect{v}}{2}\) =\tens{0} \\
  & \rho \vect{\dot{v}} - \nablav \cdot \tens{\sigma} = \rho \vect{b}
\end{align*}
can be written as:
\begin{equation}
  \label{eq:general_conservative_EP}
  \Ucb_t + \sum_{i=1}^D \drond{\Fcb\cdot \vect{e}_i}{x_i} = \Scb
\end{equation}
 where the conserved quantities, flux and source term vectors are:
\begin{equation}
  \label{eq:vectors_plasticity}
  \Ucb =\matrice{\vect{v} \\ \tens{\eps}} \quad ; \quad \Fcb\cdot\vect{e}_i = \matrice{-\frac{1}{\rho}\tens{\sigma}\cdot\vect{e}_i\\-\frac{\vect{v}\otimes\vect{e}_i +\vect{e}_i \otimes\vect{v} }{2} } \quad ; \quad \Scb = \matrice{ \vect{b} \\\tens{0}}
\end{equation}
Analogously to hyperelasticity, a quasi-linear form involving the elastoplastic tangent modulus \eqref{eq:elastoplastic_tangent} is derived by means of the auxiliary vector $\Qcb=\matrice{\vect{v}\\ \tens{\sigma}}$ and the chain rule:
\begin{equation}
  \Qcb_t + \Absf^i \drond{\Qcb}{x_i} = \Scb \qquad \text{with: }\Absf^i = -\matrice{\tens{0}^2 & \frac{1}{\rho}\tens{I}\otimes\vect{e}_i\\ \Cbb^{ep}\cdot \vect{e}_i & \tens{0}^4}  \label{eq:EP_quasilinear}
\end{equation}

%%% Local Variables:
%%% mode: latex
%%% ispell-local-dictionary: "american"
%%% TeX-master: "../mainManuscript"
%%% End:


\section*{Problem 1 Solution}

\begin{enumerate}[a)]

\item

 In a symmetric spherical system, the one-speed, steady-state diffusion equation is
$$ -D \lap \phi(r) + \Sigma_a (r) \phi(r) = \nu \Sigma_f(r) \phi(r) + S(r) .$$
For any arbitrary function, $f(r,\theta,\varphi)$, the full Laplacian in spherical coordinates is
$$ \lap f(r,\theta,\varphi) = \frac{1}{r^2}\frac{\p}{\p r}\left(r^2 \frac{\p f}{\p r}\right) +  \frac{1}{r^2 \sin\theta} \frac{\p}{\p \theta}\left(\sin\theta \frac{\p f}{\p \theta}\right) + \frac{1}{r^2 \sin^2 \theta} \frac{\p^2 f}{\p \varphi^2} .$$
If the function $f(r,\theta,\varphi)$ is radially symmetric then $f(r,\theta,\varphi) = f(r)$, and there will be no variation in the $\theta$ or $\varphi$ directions ($\frac{\p f}{\p \theta} = 0$ and $\frac{\p f}{\p \varphi} = 0$).  The second and third terms vanish, and
$$ \lap f(r) = \frac{1}{r^2}\frac{\p}{\p r}\left(r^2 \frac{\p f}{\p r}\right) .$$
We substitute this back into our one-speed, steady-state diffusion equation, using $\phi(r)$ instead of $f(r)$.
$$ -D \frac{1}{r^2}\frac{\p}{\p r}\left(r^2 \frac{\p \phi(r)}{\p r}\right) + \Sigma_a (r) \phi(r) = \nu \Sigma_f(r) \phi(r) + S(r) .$$
Finally, we recognize that our problem has two regions. There is no external source in either, so $S(r) = 0$. Since the regions are homogeneous, the diffusion coefficients and cross sections are constant in each: $D_C$, $\Sigma_{a,C}$, $\nu$, and $\Sigma_f$ in the core; $D_R$ and $\Sigma_{a,R}$ in the reflector. We will define the outer radius of the core as $a$, and the outer radius of the reflector as $\frac{3a}{2}$. Then, our diffusion equations for both regions are:
$$ -D_C \frac{1}{r^2}\frac{\p}{\p r}\left(r^2 \frac{\p \phi(r)}{\p r}\right) + \Sigma_{a,C} \phi(r) = \nu \Sigma_f \phi(r), \quad 0 < r < a \quad\text{(core)} $$
$$ -D_R \frac{1}{r^2}\frac{\p}{\p r}\left(r^2 \frac{\p \phi(r)}{\p r}\right) + \Sigma_{a,R}\phi(r) = 0, \quad a < r < \frac{3a}{2} \quad\text{(reflector)}.$$
For our final solution, we will make two more substitutions, $B_C^2 = \frac{\nu\Sigma_f - \Sigma_{a,C}}{D_C}$ and $L_R^2 = \frac{D_R}{\Sigma_{a,R}}$, to get
$$ \frac{1}{r^2}\frac{\p}{\p r}\left(r^2 \frac{\p \phi(r)}{\p r}\right) - B_C^2 \phi(r) = 0, \quad 0 < r < a \quad\text{(core)} $$
$$ \frac{1}{r^2}\frac{\p}{\p r}\left(r^2 \frac{\p \phi(r)}{\p r}\right) - \frac{1}{L_R^2}\phi(r) = 0, \quad a < r < \frac{3a}{2} \quad\text{(reflector)} .$$
There are also four boundary conditions that accompany these equations. A vacuum boundary condition (where we will use the extrapolated distance $d$ to indicate where the flux goes to zero), a finiteness condition, and two interface conditions (both continuous current and flux at the boundary).
\begin{align*}
&(1)& \phi(r) &< \infty  						& &\text{(flux finiteness)} \\
&(2)& \phi_R\left(\frac{3a}{2} + d\right) &= 0 	& &\text{(vacuum)} \\
&(3)& \phi_C(a) &= \phi_R(a)					& &\text{(continuous flux)} \\
&(4)& J_C(a) &= J_R(a)							& &\text{(continuous current)}
\end{align*}

\item

Since the diffusion equation takes a different form in each region, the solutions describing the flux shapes in those regions are also different. In the core, the flux has the functional form
$$ \phi_C(r) = \frac{A_C}{r} \sin\left(B_C r\right) + \frac{B_C}{r} \cos\left(B_C r\right) , \quad 0 < r < a,$$
and in the reflector,
$$ \phi_R(r) = \frac{A_R}{r}\sinh\left(\frac{r+\omega}{L_R}\right) + \frac{B_R}{r} \cosh\left(\frac{r+\omega}{L_R}\right), \quad\quad\quad a < r < \frac{3a}{2} .$$
Here we have included the shift in position of the hyperbolic sines and cosines, which is an equally valid solution to the diffusion equation in the reflector region. The usefulness of this parameter will become apparent shortly.

Imposing our first boundary condition (finite flux everywhere), we notice that the second term in the flux solution for the core goes to infinity as $r$ goes to zero ($\frac{1}{r} \rightarrow \infty$ and $\cos(\kappa r) \rightarrow 1$). For the finiteness condition to be satisfied, we must set $B_C = 0$. Considering the second boundary condition (vacuum outside of the reflector), we have the equation
$$ \phi_R\left(\frac{3a}{2}+d\right) = 0 = \frac{A_R}{\frac{3a}{2}+d}\sinh\left(\frac{\frac{3a}{2}+d+\omega}{L_R}\right) + \frac{B_R}{\frac{3a}{2}+d} \cosh\left(\frac{\frac{3a}{2}+d+\omega}{L_R}\right) .$$
Noting that the hyperbolic cosine never gives a value of zero, we can conclude that $B_R = 0$.  Furthermore, the value of the hyperbolic sine only gives a value of zero when it's argument is equal to zero. To satisfy this, $\omega = -\left(\frac{3a}{2}+d\right)/L_R$.

From these two boundary conditions, our flux shapes simplify to
$$ \phi_C(r) = \frac{A_C}{r} \sin\left(B_C r\right) , \quad 0 < r < a,$$
$$ \phi_R(r) = \frac{A_R}{r}\sinh\left(\frac{r-\left(\frac{3a}{2}+d\right)}{L_R}\right), \quad a < r < \frac{3a}{2} .$$
We now use these simpler equations together with our second two boundary conditions. Starting with the flux continuity equation:
$$ \phi_C(a) = \phi_R(a) $$
$$ \frac{A_C}{a} \sin\left(B_C a\right) = \frac{A_R}{a}\sinh\left(\frac{a-\left(\frac{3a}{2}+d\right)}{L_R}\right) $$
$$ A_C = A_R \frac{\sinh\left(-\frac{a+2d}{2L_R}\right)}{\sin\left(B_C a\right)} .$$

Next we move to the current continuity equation, first writing the condition in terms of flux using Fick's law:
$$ J_C(a) = J_R(a) $$
$$ -D_C\frac{d}{dr}\phi_C(a) = -D_R\frac{d}{dr}\phi_R(a) .$$
Substituting in our flux equations,
$$ -D_C\frac{d}{dr}\left(\frac{A_C}{r} \sin\left(B_C r\right)\right)\bigg|_{r=a} = -D_R\frac{d}{dr}\left(\frac{A_R}{r}\sinh\left(\frac{r-\left(\frac{3a}{2}+d\right)}{L_R}\right)\right)\bigg|_{r=a} $$
$$ -D_C \left[\frac{A_C B_C}{r}\cos\left(B_C r\right) - \frac{A_C}{r^2}\sin\left(B_C r\right)\right]_{r=a} = -D_R \left[\frac{A_R}{r L_R}\cosh\left(\frac{r-\left(\frac{3a}{2}+d\right)}{L_R}\right) - \frac{A_R}{r^2}\sinh\left(\frac{r-\left(\frac{3a}{2}+d\right)}{L_R}\right)\right]_{r=a} $$
$$ -A_C D_C \left[\frac{B_C}{a}\cos\left(B_C a\right) - \frac{1}{a^2}\sin\left(B_C a\right)\right] = -A_R D_R \left[\frac{1}{a L_R}\cosh\left(\frac{a-\left(\frac{3a}{2}+d\right)}{L_R}\right) - \frac{1}{a^2}\sinh\left(\frac{a-\left(\frac{3a}{2}+d\right)}{L_R}\right)\right]$$
$$ A_C = A_R \frac{D_R \left[\frac{a}{L_R}\cosh\left(-\frac{a+2d}{2L_R}\right) - \sinh\left(-\frac{a+2d}{2L_R}\right)\right]}{D_C \left[a B_C \cos\left(B_C a\right) - \sin\left(B_C a\right)\right]}.$$
At this point, we may realize that these two continuity boundary conditions have given us two equations where $A_C$ is just proportional to $A_R$. In both cases the factor multiplying $A_R$ is a constant, where $a$, $L_R$, and $B_C$ are known quantities. Intuitively, this means that if our reflected reactor is critical then we may have many different flux magnitudes, but always the same general shape. (In other words, a reactor may be critical with many different neutron populations---this is how reactors can be critical over a range of different power levels---but the general function describing where those neutrons are is always similar.) The answer to the question can the be left as
$$\boxed{\begin{aligned}
\quad \phi_C(r) &= \frac{A}{r} \sin\left(B_C r\right) ,& \quad 0 <& r < a \quad \\
\quad \phi_R(r) &= \frac{A \sin\left(B_C a\right)}{r \sinh\left(-\frac{a+2d}{2L_R}\right)}\sinh\left(\frac{r-\left(\frac{3a}{2}+d\right)}{L_R}\right),& \quad a <& r < \frac{3a}{2} \quad
\end{aligned}}$$
where we have dropped the subscript from the constant, $A$. \\

\item

The reflector savings is given by the difference between the critical dimensions of a reflected reactor and a bare reactor of the same shape.
$$ \mathcal{S} = a_{\text{ref}} - a_{\text{bare}} $$
From the previous section, for both equations we found to be true, the two factors multiplying $A_R$ must be equal. While we cannot determine a unique flux magnitude, we can relate the given quantities to find $a$:
$$ \frac{\sinh\left(\frac{a}{L_R}\right)}{\sin\left(B_C a\right)} = \frac{D_R \left[\frac{a}{L_R}\cosh\left(-\frac{a+2d}{2L_R}\right) - \sinh\left(-\frac{a+2d}{2L_R}\right)\right]}{D_C \left[a B_C \cos\left(B_C a\right) - \sin\left(B_C a\right)\right]}.$$
This equation is transcendental and it is impossible to calculate a solution analytically, so instead we must solve it numerically. Though we won't actually perform the numerical calculation here,
$$ a_{\text{ref}} = a .$$

For a bare sphere, $a_{\text{bare}}$ can be found using the geometric buckling (equal to the material buckling which is the same for both cores):
$$ B_{g,\text{bare}}^2 = B_C^2 = \left(\frac{\pi}{\tilde{a}_{\text{bare}}}\right)^2 .$$
We note $\tilde{a}_{\text{bare}} = a_{\text{bare}} + d_{\text{bare}}$, and
$$ a_{\text{bare}} = \frac{\pi}{B_C} - d_{\text{bare}} .$$
We plug these in to find the reactor savings.
$$\boxed{ \mathcal{S} = a - \frac{\pi}{B_C} + d_{\text{bare}} }$$
\end{enumerate}


\documentclass[a4paper]{article}

\usepackage[english]{babel}
\usepackage[utf8x]{inputenc}
\usepackage{amsmath}
\usepackage{graphicx}

\title{MATH 542 Homework 8}
\author{Saket Choudhary\\skchoudh@usc.edu}

\begin{document}
\maketitle
\subsection*{Problem 3a.2}
Consider $||\boldmath{Y}-\boldmath{X\beta}||^2$.  Since X is full rank $\hat{\beta} = (X'X)^{-1}X'Y$
This involves $\frac{||\boldmath{Y}-\boldmath{X\beta}||^2}{\partial \beta_i}=0$
Also $\hat{Y_i}=\beta_0+x_{i1}\beta_1 + \dots + x_{ip-1}\beta_{p-1} $
For $i=0$:
\begin{align*}
\frac{||\boldmath{Y}-\boldmath{X\beta}||^2}{\partial \beta_i}&=0\\
\frac{\sum( Y_i-(\beta_0+x_{i1}\beta_1 + \dots + x_{ip-1}\beta_{p-1} ) )^2 }{\partial \beta_0} &= 0\\
\sum( Y_i-(\beta_0+x_{i1}\beta_1 + \dots + x_{ip-1}\beta_{p-1} ) ) &= 0\\
\sum( Y_i-\hat{Y_i} ) &= 0\\
\end{align*}
\subsection*{Problem 3a.3}
\begin{align*}
\begin{pmatrix}Y_1\\Y_2\\Y_3
\end{pmatrix}&= \begin{pmatrix}1 &0\\ 2 & -1\\ 1 & 2\end{pmatrix}\begin{pmatrix}\theta\\ \phi \end{pmatrix}\\
\end{align*}
Thus $X=\begin{pmatrix}1 &0\\ 2 & -1\\ 1 & 22\end{pmatrix}$
$\beta=X'X$ and hence using R:
\begin{align*}
\theta = 0.167 Y_1 + 0.333 Y_2 + 0.167 Y_3\\
\phi = -0.2Y_2+0.4Y_3
\end{align*}
\subsection*{Problem 3a.4}
\begin{align*}
\begin{pmatrix}Y_1\\Y_2\\Y_3
\end{pmatrix}&= \begin{pmatrix}1 &-1 &1\\ 1 & 0 & -2\\ 1 & 1 &1\end{pmatrix}\begin{pmatrix}\beta_0\\ \beta_1 \\ \beta_2\end{pmatrix}\\
\end{align*}

\begin{align*}
\begin{pmatrix}\beta_0\\ \beta_1 \\ \beta_2\end{pmatrix}&= (X'X)^{-1}X'Y\\
\begin{pmatrix}\beta_0\\ \beta_1 \\ \beta_2\end{pmatrix}&= \begin{pmatrix}\frac{1}{3} & \frac{1}{3} & \frac{1}{3}\\ -0.5 & 0 & 0.5\\ \frac{1}{6} & -\frac{1}{3} & \frac{1}{6}\end{pmatrix}\begin{pmatrix}Y_1\\Y_2\\Y_3
\end{pmatrix}
\end{align*}
Consider $\beta_2=0$:

\begin{align*}
\begin{pmatrix}Y_1\\Y_2\\Y_3
\end{pmatrix}&= \begin{pmatrix}1 &-1 \\ 1 & 0 \\ 1 & 1\end{pmatrix}\begin{pmatrix}\beta_0\\ \beta_1 \\\end{pmatrix}\\
\end{align*}

Then using R:
\begin{align*}
\begin{pmatrix}\beta_0\\ \beta_1\end{pmatrix}&= (X'X)^{-1}X'Y\\
\begin{pmatrix}\beta_0\\ \beta_1\end{pmatrix}&= \begin{pmatrix}\frac{1}{3} & \frac{1}{3} & \frac{1}{3}\\ -0.5 & 0 & 0.5\\ \end{pmatrix}\begin{pmatrix}Y_1\\Y_2\\Y_3
\end{pmatrix}
\end{align*}

\subsection*{Problem 3a.7}
$\hat{Y} = X\hat{\beta} = PY$
\begin{align*}
\sum \hat{Y_i}(Y_i-\hat{Y_i}) &= \hat{Y'}(Y-\hat{Y'}\\
&= Y'P'(Y-PY)\\
&= Y'P(I_n-P)Y\\
&= Y'(P-P^2)Y\\
&=0\text{ Since P is idempotent}
\end{align*}
\subsection*{Problem 3b.3}
Consider $\bar{Y} = \frac{\sum_i Y_i}{n}$

$E[\bar{Y}] = \theta$ so $\bar{Y}$ is unbiased estimate.

Also using Rao's minimum variance lower bound, $\alpha'\beta$ is a minimum variance estimate for $\mathcal{N}(X\beta, \sigma^2)$, Thus $\bar{Y}$ is both unbiased and minimum variance.

\subsection*{Problem 3b.4}

\begin{align*}
Y_i &= \beta_0+\beta_1(x_{i1}-\bar{x_1}) + \beta_2(x_{i2}-\bar{x_2})+\epsilon_i\\
\begin{pmatrix}Y_1\\Y_2\\Y_3\\\vdots\\Y_n
\end{pmatrix}&= \begin{pmatrix} 1 & x_{11}-\bar{x_1} & x_{12}-\bar{x_2}\\
 1 & x_{21}-\bar{x_1} & x_{22}-\bar{x_2}\\
 \vdots & \vdots & \vdots\\
 1 & x_{n1}-\bar{x_1} & x_{n2}-\bar{x_2}\\
\end{pmatrix}\begin{pmatrix}
\beta_0\\\beta_1\\\beta_2
\end{pmatrix}\\
X &= \begin{pmatrix} 1 & x_{11}-\bar{x_1} & x_{12}-\bar{x_2}\\
 1 & x_{21}-\bar{x_1} & x_{22}-\bar{x_2}\\
 \vdots & \vdots & \vdots\\
 1 & x_{n1}-\bar{x_1} & x_{n2}-\bar{x_2}\\
\end{pmatrix}\\
X'X &= \begin{pmatrix}
n & \sum x_{i1}-n\bar{x_1} & \sum x_{i2} - n \bar{x_2}\\
\sum x_{i1}-n\bar{x_1} & \sum(x_{i1}-\bar{x_1})^2 & \sum (x_{i1}-\bar{x_1})(x_{i2}-\bar{x_2})\\
\sum x_{i2}-n\bar{x_2} & \sum (x_{i1}-\bar{x_1})(x_{i2}-\bar{x_2}) & \sum(x_{i2}-\bar{x_2})^2
\end{pmatrix}\\
& = \begin{pmatrix}
n & 0 & 0\\
0 & \sigma^2_{1} & r\sigma_1\sigma_2\\
0 & r\sigma_1\sigma_2 & \sigma_2^2
\end{pmatrix}\\
(X'X)^{-1} & = \frac{1}{\sigma_1^2\sigma_2^2(1-r^2)} \begin{pmatrix}
\frac{1}{n(\sigma_1^2\sigma_2^2(1-r^2))} & 0 & 0\\
0 & \sigma^2_{2} & r\sigma_1\sigma_2\\
0 & r\sigma_1\sigma_2 & \sigma_1^2
\end{pmatrix}\\
\end{align*}
Thus $Var(\beta_1) = \sigma^2 (X'X)^{-1} = \frac{\sigma^2 \sigma_2^2}{\sigma_1^2\sigma_2^2(1-r^2)} = \frac{\sigma^2}{\sigma_1^2(1-r^2)}$
\end{document}


\section{2D \texorpdfstring{$U(1)$}{U (1)} Lattice Gauge Theory}%
\label{sec:l2hmc_u1}
All lattice QCD simulations are performed at finite
lattice spacing $a$ and need an extrapolation to the continuum in order to be
used for computing values of physical quantities.
%
More reliable extrapolations can be done by simulating the theory at
increasingly smaller lattice spacings.
%
The picture that results when the lattice spacing is reduced and the physics
kept constant is that all finite physical quantities of negative mass dimension
diverge if measured in lattice units.
%
In statistical mechanics language, this states that the continuum limit is a
critical point of the theory since correlation lengths diverge.
%
MCMC algorithms are known to encounter difficulties when used for simulating
theories close to a critical point, an issue known as the \emph{critical slowing
down} of the algorithm.
%
This effect is most prominent in the topological charge, whose auto-correlation
time increases dramatically with finer lattice spacings.
%
As a result, there is a growing interest in developing new sampling techniques
for generating equilibrium configurations.
%
In particular, algorithms that are able to offer improvements in efficiency
through a reduction of statistical autocorrelations are highly desired.
%
We begin with the two-dimensional $U{(1)}$ lattice gauge theory with dynamical
variables $U_{\mu}{(i)}$ defined on the links of a lattice, where $i$ labels a
site and $\mu$ specifies the direction.
%
Each link $U_{\mu}{(i)}$ can be expressed in terms of an angle $0 <
\phi_{\mu}{(i)} \leq 2 \pi$.
%
\begin{equation}
    U_{\mu}{(i)} = e^{i\phi_{\mu}{(i)}}
    \label{eq:link_variable}
\end{equation}
%
with the Wilson action defined as:
%
\begin{equation}
    \beta S = \beta \sum_{P}{(1 - \cos{(\phi_{P})})}
    \label{eq:wilson_action}
\end{equation}
%
where
%
\begin{equation}
    \phi_{P} \equiv \phi_{\mu\nu}(i) =
        \phi_{\mu}{(i)} + \phi_{\nu}{(i + \hat{\mu})}
        - \phi_{\mu}{(i + \hat{\nu})} - \phi_{\nu}{(i)}
    \label{eq:phi_plaquette}
\end{equation}
%theta_
and $\beta = 1/e^{2}$ is the gauge coupling, and the sum $\sum_{P}$ runs over
all plaquettes of the lattice.
%
An illustration showing how these variables are defined for an elementary
plaquette is shown in Fig.~\ref{fig:plaquette}.
%
\begin{figure}[htpb]
  \centering
  \includegraphics[width=0.5\textwidth]{gauge_figures/plaq.png}
  \caption{Illustration of an elementary plaquette on the lattice.}%
\label{fig:plaquette}
\end{figure}

We can define the topological charge, $\mathcal{Q} \in \mathbb{Z}$, as
%
\begin{equation}
  \mathcal{Q} \equiv \frac{1}{2\pi}\sum_{P} \tilde \phi_{P} =
    \frac{1}{2\pi}\sum_{\substack{{i; \mu, \nu}\\{\nu > \mu}}}
    \tilde \phi_{\mu\nu}{(i)}
    \label{eq:topological_charge}
\end{equation}
%
where
%
\begin{equation}
  \tilde{\phi}_{P} \equiv \phi_{P} - 2\pi {\bigg\lfloor{\frac{\phi_{P} +
  \pi}{2\pi}\bigg\rfloor}}
  % \tilde{\phi}_{P} \equiv \phi_{P} - 2 \pi \left \lfloor{\frac{\phi_{P} +
  % \pi}{2 \pi}\right \rfloor}
\end{equation}
%
is the sum of the link variables around the elementary plaquette, projected
onto the interval $\left[0, 2 \pi\right)$.
%
From this, we can define topological susceptibility
%
\begin{equation}
    \chi \equiv \frac{\langle \mathcal{Q}^2\rangle - \langle \mathcal{Q} \rangle^2}{V}
    % \label{eq:topological_susceptibility}
\end{equation}
%
By parity symmetry, $\langle \mathcal{Q} \rangle = 0$, so we have that
\begin{equation}
    \chi = \frac{\langle \mathcal{Q}^2\rangle}{V}
    \label{eq:topological_susceptibility}
\end{equation}
%
Unfortunately, the measurement of $\chi$ is often difficult due to the fact
that the autocorrelation time with respect to $\mathcal{Q}$ tends to be extremely long.
%
This is a consequence of the fact that the Markov chain tends to get stuck in a
topological sector (characterized by $\mathcal{Q} = const$.), a phenomenon known as
\emph{topological freezing}.
%
% (right) Topological charge vs.\ step generated using the trained
% L2HMC sampler.}%
\begin{figure}[htpb]
  \centering
    % \includegraphics[width=0.49\textwidth]{top_charge_vs_step_hmc.eps}
    % \includegraphics[width=0.49\textwidth]{top_charge_vs_step_l2hmc.eps}
    \includegraphics[width=0.6\textwidth]{charge_plots/top_charge_vs_step_HMC}
    % \includegraphics[width=0.49\textwidth]{charge_plots/compare/top_charge_vs_step_hmc}
    % \includegraphics[width=0.49\textwidth]{charge_plots/compare/top_charge_vs_step_l2hmc}
    \caption{Example of topological freezing in the $2D$ $U{(1)}$
      lattice gauge theory. The above result was generated using generic HMC
      sampling for a $8\times8$ lattice. Note that for the majority of the
      simulation $\mathcal{Q}=0$, making it virtually impossible to get a reasonable
    estimate of $\chi$.}\label{fig:top_charge}
  \end{figure}
%
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\subsection{Annealing Schedule}%
\label{subsec:l2hmc_u1annealing}
% In addition to modifying the neural network architecture, we also modified
% the training algorithm to follow a simulated annealing schedule.
%
Proceeding as in the example of the Gaussian Mixture Model, we include a
simulated annealing schedule in which the value of the gauge coupling $\beta$
is continuously updated according to the annealing schedule shown in
Eq.~\ref{eq:annealing_schedule}.
%
% Explicitly, the value of the gauge coupling $\beta$ is continuously updated
% according to the annealing schedule shown in Eq.~\ref{eq:annealing_schedule}.
%
This was done in order to encourage sampling from multiple different
topological charge sectors, since our sampler is less `restricted' at lower
values of $\beta$.
%This was don
\begin{equation}
  \frac{1}{\beta(n)} = {\left(\frac{1}{\beta_{i}}
    - \frac{1}{\beta_{f}}\right)}
    {\left(\frac{1 - n}{N_{\mathrm{train}}}\right)}
    + \frac{1}{\beta_{f}}
\label{eq:annealing_schedule}
\end{equation}
%
Here $\beta(n)$ denotes the value of $\beta$ to be used for the
$n^{\mathrm{th}}$ training step ($n = 1, \ldots, N_{\mathrm{train}}$),
$\beta_{i}$ represents the initial value of $\beta$ at the beginning of the
training, and $\beta_{f}$ represents the final value of $\beta$ at the end of
training.
%
For a typical training session, $N_{\mathrm{train}} = 25,000$, $\beta_{i} = 2$
and $\beta_{f} = 5$.
% For all of the exmaples above, $N_{\mathrm{train}} = 25,000$, $\beta_{0} = 2$
% and $\beta_{N_{\mathrm{train}}} = 5$.
%
% As can be seen in Fig.~\ref{fig:top_charge}

\subsection{Modified metric for \texorpdfstring{$U(1)$}{U (1)} Gauge
Model}%
\label{subsec:l2hmc_modifiedloss}
%
In order to more accurately define the ``distance'' between two different
lattice configurations, we redefine the metric in Eq.~\ref{eq:metric_orig} to
be
%
\begin{equation}
  % \delta(\xi(\phi_{\mu}(x)), \xip(\phi_{\mu}(x))) \equiv 1 -
  % \cos\left(\xi(\phi_{\mu}(x)) - \xi^{\prime}(\phi_{\mu}(x))\right)
  \delta(\xi, \xip) \equiv 1 - \cos\left(\xi - \xi^{\prime}\right)
\label{eq:new_metric}
\end{equation}
%
where now $\xi \equiv {\left(\phi_{\mu}^{x}(i), \,\phi_{\mu}^{v}(i),\,
d\right)}$, with $\phi_{\mu}^{x}$ representing the lattice of (`position')
gauge variables (what we called $x$ previously), and $\phi_{\mu}^{v}$
representing the lattice of (`momentum') gauge variables (what we called $v$
previously). Note that $i$ runs over all lattice sites\footnote{In what
  follows, we will refrain from explicitly including the site index and make
  the assumption that it implicitly extends over all sites on the lattice.} and
  $\mu=0, 1$ for the two dimensional case.
%
We see that this metric gives the expected behavior, since $\delta \rightarrow
0$ for $\xi \approx \xip$.

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% \subsection{Issues with the Average Plaquette}
% %
% When running inference using the trained sampler, an issue was encountered in
% which the average plaquette, $\langle \phi_{P}\rangle$ seems to converge to a
% value which is noticeably different from the expected value in the infinite
% volume limit, and can be seen in Fig.~\ref{fig:bad_convergence}.
% %
% In order to quantify this unexpected behavior, we can calculate the difference
% between the observed value of the average plaquette, $\langle \phi_{P}\rangle$
% and the expected value $\phi_{P}^{(*)}$ (calculated from the infinite volume
% limit):
% %
% \begin{equation}
%   {\delta_{\phi_P}}(\alpha_Q, N_{\mathrm{LF}}) \equiv \langle \phi_P\rangle -
%   \phi_{P}^{(*)} \neq 0.
%   % - \langle{\phi_{P}^{\mathrm{(exact)}}}\rangle \neq 0}.
% \end{equation}
% %
% % Which allows us to quantify this difference.%
%
%
% % Upon further testing, an issue was encountered in which the
% % of the average plaquette
% % $\langle \phi_{P}\rangle$ seems to converge to a value which is noticeably
% % different from the expected value in the infinite volume limit.
% %
% % This behavior can be seen in Fig.~\ref{fig:bad_convergence}, and seems to
% % depend on both the number of augmented leapfrog steps used by our integrator,
% % as well as the `strength' of the topological loss term in
% % Eq.~\ref{eq:topological_loss_term}.
% %
% % The parameters used in Fig~\ref{fig:bad_convergence} are as follows: $L = 8$,
% % $N_{\mathrm{LF}} = 7$, and $N_{\mathrm{samples}} = 128$,
% % and the sampler was trained for $N_{\mathrm{train}} = 1\times10^{4}$.
% %
% % In Fig~\ref{fig:good_convergence}, the only change was the weight factor for
% % the topological charge term in the loss function $\alpha_{Q} = 0$.
% %
% \begin{figure}[htpb]%
%   \centering
%     \includegraphics[width=0.49\textwidth]{new_figures/plaq_error/plaqs_diffs_vs_step_l2hmc_lf16.pdf}
%     \includegraphics[width=0.49\textwidth]{new_figures/plaq_error/plaqs_diffs_vs_step_hmc_lf16.pdf}
%     % \includegraphics[width=0.49\textwidth]{plaq_plots/plaqs_diffs_vs_step_bad.pdf}
%     \caption{Difference between the observed and expected value of the average
%       plaquette, $\delta_{\phi_{P}}$, \textbf{(left)}: using the trained L2HMC
%       sampler, and \textbf{(right)}: using generic HMC.}%
%       % trained L2HMC sampler \textbf{(left)} and generic HMC \textbf{(right)} .
%       % HMC result, obtained by setting $\alpha_{S} = \alpha_{Q} = \alpha{T} = 0$
%       % \textbf{(right)}:
%       % \ref{subsec:net_weights}).}%
% \label{fig:bad_convergence}
% \end{figure}%
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%


%!TEX root = ../thesis.tex
% ******************************* Thesis Appendix A ****************************

\chapter{Additional Derivations}

\section{Holland cost}
\label{app:holland-cost}
Following Holland's~\cite{holland1977cost} derivation of a stochastic control problem for the Schr\" odinger equation. We start by introducing the exponential transform
\begin{equation}
	\psi(x)=\exp [-U(x)],
\end{equation}
into the Schro\" odinger equation for $x \in \mathbb{R}^{n}$
\begin{equation}
	H \psi=\left[-\frac{1}{2} \nabla^{2}+V(x)\right] \psi=\lambda \psi,
\end{equation}
to obtain
\begin{equation}
	\label{eq:a-hc1}
	\frac{1}{2} \nabla^{2} U-\frac{1}{2}(\nabla U)^{2}+V(x)=\lambda.
\end{equation}
We can reinterpret the second term in eq.~\eqref{eq:a-hc1} as a minimum over all vectors $v$ for every $x \in \mathbb{R}^{n}$
\begin{equation}
	\label{eq:a-hc2}
	\frac{1}{2} \nabla^{2} U+\min_{v}\left[v \cdot \nabla U+\frac{1}{2}|v|^{2}+V(x)\right]=\lambda.
\end{equation}
We define $v$ to be a Lipshitz continuous function, i.e. the drift $v(x)$. Each drift now generates an It\^ o process
\begin{equation}
	\label{eq:a-hc3}
	\mathrm{d}X_{t}=\mathrm{d}W_{t}+v\left(X_{t}\right) \mathrm{d}t \quad \text{ and } \quad X_0 = x,
\end{equation}
and we can define the cost function $C[v]$ for each $v$ as
\begin{equation}
	\label{eq:a-hc4}
	C[v]=\lim _{T \rightarrow \infty} \frac{1}{T} \mathbb{E}\left[\int \left(\frac{1}{2}\left|v\left(X_{t}\right)\right|^{2}+V\left(X_{t}\right)\right)\mathrm{d}x \right].
\end{equation}
Holland~\cite{holland1977cost} proves the following theorem.
\begin{theorem}[Holland cost function]
	The minimum $\lambda = \min_{v} C[v]$, where the minimum is taken over drift functions $v: \Omega \rightarrow \mathbb{R}^n$, $\Omega \subset \mathbb{R}^n$ with Neumann boundary conditions $\frac{\partial \psi}{\partial n}=0 \text{ on } \partial \Omega$, is obtained only for $v=\frac{\nabla \psi}{\psi}=-\nabla U$.
\end{theorem}
\begin{proof}
	From eq.~\eqref{eq:a-hc2} follows the inequality
	\begin{equation}
		\label{eq:a-hc5}
		\frac{1}{2} \nabla^{2} U+v \cdot \nabla U+\frac{1}{2}|v(x)|^{2}+V(x) \geq \lambda,
	\end{equation}
	we notice that the first two terms are an infinitesimal generator $[\mathcal{L}_G U](x)$ of the process in eq.~\eqref{eq:a-hc3}, which is defined as
	\begin{equation}
		\left[\mathcal{L}_{\mathrm{G}} \psi\right](x) \equiv \lim _{t \rightarrow 0} \frac{\mathbb{E}_{x}\left[\psi\left(X_{t}\right)\right]-\psi(x)}{t},
	\end{equation}
	where $\mathbb{E}_x$ is over processes with initial condition $X_0 = x$.
	With this in mind, we evaluate eq.~\eqref{eq:a-hc5} on the process $X_t$ and integrate over time to obtain
	\begin{equation}
		\frac{\mathbb{E}\left[U\left(X_{T}\right)-U(x)\right]}{T}+\mathbb{E}\left[\frac{1}{T}\int_{0}^{T} \left(\frac{1}{2}\left|v\left(X_{t}\right)\right|^{2}+V\left(X_{t}\right)\right)\mathrm dt\right] \geq \lambda.
	\end{equation}
	In the $T \rightarrow \infty$ limit, the first terms disappears, so long as $U$ is bounded, and we are left with $C[v]$, meaning that we have proven the bound
	\begin{equation}
		C[v] \geq \lambda.
	\end{equation}
	We see that the minimum $\lambda$ is achieved for control function
	\begin{equation}
		v = \frac{\nabla \psi}{\psi} = -\nabla U,
	\end{equation}
	in eq.~\eqref{eq:a-hc2}, the uniqueness of this optimal $v$ is due to the fact that if $v \neq \frac{\nabla \psi}{\psi}$ there cannot be a full equality in eq.~\eqref{eq:a-hc5}.
\end{proof}

\section{Probabilistic interpretation of Holland's cost function}
\label{app:holland-prob}
This section follows Barr et al.~\cite{barr2020quantum} which is closely related to previous work~\cite{dai1990markov}. To express the RN derivative we use the Girsanov theorem for both $\mathbb{P}_v$
\begin{equation}
	\frac{\mathrm{d} \mathbb{P}_{v}}{\mathrm{d} \mathbb{P}_{0}}=\exp \left(\int v\left(X_{t}\right) \mathrm{d} X_{t}-\frac{1}{2} \int\left|v\left(X_{t}\right)\right|^{2} \mathrm{d} t\right),
\end{equation}
and $\mathbb{P}_{\mathrm{FK}}$
\begin{equation}
	\label{eq:a-hp2}
	\frac{\mathrm{d} \mathbb{P}_{\mathrm{FK}}}{\mathrm{d} \mathbb{P}_{0}}=\mathcal{N} \exp \left(-\int V\left(X_{t}\right) \mathrm{d} t\right).
\end{equation}
We combine both, and we have up to exponential accuracy $\mathcal{N} \sim e^{\lambda T}$
\begin{equation}
	\log \left(\frac{\mathrm{d} \mathbb{P}_{v}}{\mathrm{d} \mathbb{P}_{\mathrm{FK}}}\right)=\log \left(\frac{\mathrm{d} \mathbb{P}_{v}}{\mathrm{d} \mathbb{P}_{0}} \frac{\mathrm{d} \mathbb{P}_{0}}{\mathrm{d} \mathbb{P}_{\mathrm{FK}}}\right) = \int v\left(X_{t}\right) \mathrm{d} X_{t}+\int \left(-\frac{1}{2}\left|v\left(X_{t}\right)\right|^{2}+V\left(X_{t}\right)\right)\mathrm{d} t - \lambda T,
\end{equation}
finally we substitute $\mathrm{d} X_t = \mathrm{d}W_t + v(X_t)\mathrm{d}t$ to get
\begin{equation}
	\begin{aligned}
	\log \left(\frac{\mathrm{d} \mathbb{P}_{v}}{\mathrm{d} \mathbb{P}_{\mathrm{FK}}}\right)
	& =  \int v\left(X_{t}\right) \mathrm{d} W_{t} + \int |v(X_t)|^2 \mathrm{d}t + \int \left(-\frac{1}{2}\left|v\left(X_{t}\right)\right|^{2}+V\left(X_{t}\right)\right)\mathrm{d} t\\
	& =  \int v\left(X_{t}\right) d W_{t}+\int \left(\frac{1}{2}\left|v\left(X_{t}\right)\right|^{2}+V\left(X_{t}\right)\right) \mathrm{d}t  - \lambda T.
	\end{aligned}
\end{equation}
A closer look at the normalisation constant $\mathcal{N}$ in eq.~\eqref{eq:a-hp2} gives rise to the boundary term. The normalisation is given by
\begin{equation}
	\mathcal N = \frac{\tilde{\psi}\left(r_{T}, T\right)}{\bar{\psi}\left(r_{0}, 0\right)},
\end{equation}
where $\tilde{\psi}\left(r_{t}, t\right)$ is the solution to the backwards imaginary time Schr\" odinger equation~\cite{barr2020quantum}, and is related to the distribution of the stochastic process in eq.~\eqref{eq:a-hc3} as
\begin{equation}
	\pi(r, t) = \tilde{\psi}\left(r, t\right) \psi\left(r, t\right).
\end{equation}
If we now take both distributions at initial time $\pi(r, 0)$ and terminal time $\pi(r, T)$ to be the ground state the normalisation constant becomes
\begin{equation}
	\frac{\tilde{\psi}\left(r_{T}, T\right)}{\bar{\psi}\left(r_{0}, 0\right)} = e^{E_{0} T} \frac{\varphi_{0}\left(r_{T}\right)}{\varphi_{0}\left(r_{0}\right)},
\end{equation}
and accounts for the boundary term and $E_0 T$ term in the Kullback-Leibler divergence.

\section{Todorov cost}
\label{app:todorov-cost}
Optimal decision processes are formalised using Markov Decision processes, here we follow work of Todorov~\cite{todorov2007linearly, todorov2009efficient} to fit the imaginary Schr\" odinger equation in this mould. An MDP is a $4$-tuple $\left(S, A, P_{a}, R_{a}\right)$:
\begin{itemize}
	\item $S$: Is the \emph{state space}, i.e. all possible configurations of the system $s_k$
	\item $U$: Is the \emph{control space}, i.e. all possible single-spin flips in each configuration
	\item $P_u$: Is the probability  $p(s^{(t+1)} = s^\prime | s^{(t)} = s, u^{(t)} = u)$ of control $u$ in state $s$ leading to state $s^\prime$ in the next time step
	\item $g$: Is the cost received when moving from state $s$ to $s^\prime$ due to $u$
\end{itemize}
The optimal decision/control problem is then given by the Bellman equation for the optimal cost-to-go function $v(s)$
\begin{equation}
	\nu(s)=\min _{u}\left\{
	\underbrace{\ell(s, u)}_{\text{immediate cost}}
	+
	\underbrace{\mathbb{E}_{s^{\prime} \sim p(\cdot \mid s, u)}\left[\nu\left(x^{\prime}\right)\right]}_{\text{expected cost of next state}}
	\right\}.
\end{equation}
Todorov introduces a formalism where the agent does not perform specific symbolic actions (e.g. flips a certain spin) but is instead allowed to specify transition probabilities $u(s^\prime|s)$. Formally this means that
\begin{equation}
	p\left(s^{\prime} \mid s, u\right)=u\left(s^{\prime} \mid s\right),
\end{equation}
and the agent reshapes the dynamics of the system as it wishes, but for this it pays a price depending on how much it changes the dynamics. In absence of controls $u$ the system follows \emph{passive dynamics} $p(s^\prime | s)$ which correspond to the first term in eq.~\eqref{eq:hamilton_split} of the stoquastic Hamiltonian. The cost is thus
\begin{equation}
	\ell(s, u)=\underbrace{q(s)}_{\text{state cost}}+\underbrace{D_\mathrm{KL}((\cdot \mid s) \| p(\cdot \mid s))}_{\text{control cost}}.
\end{equation}
Optimal control problem in this form can be linearised in terms of the \emph{desirability} function $z(s, t)=\exp (-\nu(s, t))$, yielding optimal dynamics $\nu^\prime$
\begin{equation}
	\nu^{\prime}(s_j \mid s_k)=\frac{p(s_j \mid s_k) z(s_j)}{\sum_{s_l} p(s_l \mid s_k) z(s_l)},
\end{equation}
with
\begin{equation}
	\label{eq:lintod}
	z(s_k, t)=e^{-q(s_k)} \sum_{s_j} p(s_j \mid s_k) z(s_j, t+1).
\end{equation}
It is this linear equation, that we can connect to the imaginary time Schr\" odinger equation. We start by transforming the MDP into continuous time (transition probabilities to rates $p, u \rightarrow \Gamma, \Gamma^{(v)}$) as
\begin{equation}
	p(s_j \mid s_k)=\left\{\begin{array}{ll}
	1-\Delta t \sum_{s_l} \Gamma_{s_k \rightarrow s_l} & s_j=s_k \\
	\Delta t \Gamma_{s_k \rightarrow s_j} & s_j \neq s_k
	\end{array}\right.
	, \quad \text{and} \quad
	u(s_j \mid s_k)=\left\{\begin{array}{ll}
	1-\Delta t \sum_{s_l} \Gamma_{s_k \rightarrow s_l}^{(v)} & s_j=s_k \\
	\Delta t \Gamma_{s_k \rightarrow s_j}^{(v)} & s_j \neq s_k
	\end{array}\right.
\end{equation}
and setting $q(s_j) = \Delta t V(s_j)$ eq.~\eqref{eq:lintod} becomes
\begin{equation}
	\begin{aligned}
	z(s_k, t) &= e^{-\Delta t V(s_k)} \left[
				\underbrace{z(s_k, t + \Delta t) - \Delta t \sum_{s_l \neq s_k}\Gamma_{s_{k} \rightarrow s_{l}} z(s_k, t + \Delta t)}_{\text{from } s_j = s_k}
				+
				 \underbrace{\Delta t \sum_{s_j \neq s_k} \Gamma_{s_k \rightarrow s_j} z(s_j, t + \Delta t)}_{\text{from } s_j \neq s_k}
				\right] \\
			  &= \left[1 - \Delta t V(s_k) + \ldots\right]\cdot
			     \left[z(s_k, t + \Delta t)
			     - \sum_{s_j \neq s_k} \Gamma_{s_k \rightarrow s_j}
			     	\left[
			     	z(s_j, t + \Delta t) - z(s_k, t + \Delta t)\right]
		     	\right]
	\end{aligned}
\end{equation}
keeping only the first order in $\Delta t$, dropping the unnecessary $\neq$ in the sum
\begin{equation}
	\frac{z(s_k, t) - z(s_k, t + \Delta t)}{\Delta t} = V(s_k) z(s_k, t + \Delta t) - \sum_{s_j} \Gamma_{s_k \rightarrow s_j}
	\left[
	z(s_j, t + \Delta t) - z(s_k, t + \Delta t)\right]
\end{equation}
and taking the limit $\Delta t \rightarrow 0$ finally gives
\begin{equation}
	-\frac{\mathrm{d} z(s_k, t)}{\mathrm{d} t} =  V(s_k) z(s_k, t) - \sum_{s_j} \Gamma_{s_k \rightarrow s_j}
	\left[
	z(s_j, t) - z(s_k, t)\right],
\end{equation}
which is the imaginary time Schr\" odinger equation~\eqref{eq:sch_split}.

The $D_{\mathrm{KL}}$ in the loss $\ell (s, v)$ is expressed in the same manner
\begin{equation}
	\begin{aligned}
		D_{\mathrm{KL}}(v(\cdot \mid s_k) \| p(\cdot \mid s_k))
		&=\left[1-\Delta t \sum_{s_l} \Gamma_{s_k \rightarrow s_l}^{(v)}\right] \log \left[\frac{1-\Delta t \sum_{s_l} \Gamma_{s_k \rightarrow s_l}^{(v)}}{1-\Delta t \sum_{s_l} \Gamma_{s_k \rightarrow s_l}}\right]+\Delta t \sum_{s_j \neq s_k} \Gamma_{s_k \rightarrow s_j}^{(v)} \log \left[\frac{\Gamma_{s_k \rightarrow s_j}^{(v)}}{\Gamma_{s_k \rightarrow s_j}}\right]\\
		&= \Delta t \sum_{s_j \neq s_k} \Gamma_{s_k \rightarrow s_j}^{(v)}\underbrace{\left(\log \left[\frac{\Gamma_{s_k \rightarrow s_j}^{(v)}}{\Gamma_{s_k \rightarrow s_j}}\right]+\frac{\Gamma_{s_k \rightarrow s_j}}{\Gamma_{s_k \rightarrow s_j}^{(v)}}-1\right)}_{\mathrm{Itakura-Saito~divergence~} D_{\mathrm{IS}}(\Gamma_{s_k \rightarrow s_j}^{(v)}, \Gamma_{s_k \rightarrow s_j})}.
	\end{aligned}
\end{equation}
If we consider an ensemble of systems in state $s_k$ there is a $\Delta t \Gamma_{s_k \rightarrow s_j}^{(v)}$ probability of transitioning $s_k \rightarrow s_j$ in the next time increment, meaning that the ensemble contribution to the $D_{\mathrm{KL}}$ each time increment is $\sum_{s_j} \Delta t \Gamma_{s_k \rightarrow s_j}^{(v)} D_{\mathrm{IS}}\left(\Gamma_{s_k \rightarrow s_j}^{(v)}, \Gamma_{s_k \rightarrow s_j}\right)$, thus we can express the Kullback-Liebler divergence as
\begin{equation}
	D_{\mathrm{KL}}=\underset{\Sigma_{[0, t]}=k_{t} \sim \Gamma^{(v)}}{\mathbb{E}}\left[\sum_{n} D_{\mathrm{IS}}\left(\Gamma_{k^{(n)} \rightarrow k^{(n+1)}}^{(v)}, \Gamma_{k^{(n)} \rightarrow k^{(n+1)}}\right)\right].
\end{equation}
\section{Probabilistic interpretation of Todorov's cost function}
\label{app:todorov-prob}
To find the Radon-Nikodym derivative between $\mathbb{P}_v$ and $\mathbb{P}_{\mathrm{FK}}$ we proceed analogous to the continuous case, by first finding the respective RN derivatives with the passive process. From the discrete space Feynman-Kac formula~\eqref{eq:fkac_disc} follows
\begin{equation}
	\log \left(\frac{\mathrm{d} \mathbb{P}_{0}}{\mathrm{d} \mathbb{P}_{F K}}(k(t))\right)=\int V(k(t)) d t-E_{0} T-\log \left(\frac{\varphi(k^{(N)})}{\varphi(k^{(0)})}\right),
\end{equation}
and by using the Girsanov theorem equivalent for discrete space\footnote{see proposition 2.6 in Appendix 1 of~\cite{kipnis1998scaling}} we obtain
\begin{equation}
	\log \left(\frac{\mathrm{d} \mathbb{P}_{v}}{\mathrm{d} \mathbb{P}_{0}}(k(t))\right)
	=
	\int \sum_{l \neq k(t)}\left(\Gamma_{k(t) \rightarrow l}-\Gamma_{k(t) \rightarrow l}^{(v)}\right) d t+\sum_{n} \log \left(\frac{\Gamma_{k^{(n)} \rightarrow k^{(n+1)}}^{(v)}}{\Gamma_{k^{(n)} \rightarrow k^{(n+1)}}}\right).
\end{equation}
We combine both to get
\begin{equation}
	\begin{aligned}
	\log \left(\frac{\mathrm{d} \mathbb{P}_{v}}{\mathrm{~d} \mathbb{P}_{\mathrm{FK}}}\right)
	=
	\log \left(\frac{\mathrm{d} \mathbb{P}_{v}}{\mathrm{~d} \mathbb{P}_{0}} \frac{\mathrm{d} \mathbb{P}_{0}}{\mathrm{~d} \mathbb{P}_{\mathrm{FK}}}\right)
	= \tilde \ell
	+\sum_{n} \log \left(\frac{\Gamma_{k^{(n)} \rightarrow k^{(n+1)}}^{(v)}}{\Gamma_{k^{(n)} \rightarrow k^{(n+1)}}}\right)-E_{0} T-\log \left(\frac{\varphi(k^{(N)})}{\varphi(k^{(0)})}\right),
	\end{aligned}
\end{equation}
with
\begin{equation}
	\tilde \ell = \int \left[V(k(t))+\sum_{l \neq k(t)}\left(\Gamma_{k(t) \rightarrow l}-\Gamma_{k(t) \rightarrow l}^{(v)}\right)\right] \mathrm{d}t.
\end{equation}
To see that zero $D_{K L}\left(\mathbb{P}_{v} \| \mathbb{P}_{\mathrm{F K}}\right)$ coincides with rates that minimize Todorov's cost, we need
\begin{equation}
	\underset{\mathbb{P}_v}{\mathbb{E}}
	\left[
	\sum_{n} \log \left(\frac{\Gamma_{k^{(n)} \rightarrow k^{(n+1)}}^{(v)}}{\Gamma_{k^{(n)} \rightarrow k^{(n+1)}}}\right)
	\right]
	=
	\underset{\mathbb{P}_v}{\mathbb{E}}
	\left[
	\int
	\sum_{l \neq k(t)}
	\Gamma_{k(t) \rightarrow l}^{(v)} \log \left(\frac{\Gamma_{k(t) \rightarrow l}^{(v)}}{\Gamma_{k(t) \rightarrow l}}\right) \mathrm{d} t
	\right],
\end{equation}
which holds because the expectation of a contribution of a single step of the trajectory $k^{(n)} \rightarrow k^{(n+1)}$ is equivalent to an ensemble average starting from the same state weighted by the probability of jump $\Gamma_{k(t) \rightarrow l}^{(v)} \Delta t$, this holds separately for each step in the trajectory and by writing $\sum_{t_i} \cdots~\Delta t_i \rightarrow \int \cdots~\mathrm{d}t$ we obtain above equality. The KL divergence then becomes
\begin{equation}
	\begin{aligned}
		D_{\mathrm{KL}}\left(\mathbb{P}_{v} \| \mathbb{P}_{\mathrm{FK}}\right) =
		\underset{\mathbb{P}_{v}}{\mathbb{E}}\Bigg[\int V(k(t))+\sum_{l \neq k(t)}\Big(\Gamma_{k(t) \rightarrow l}&-\Gamma_{k(t) \rightarrow l}^{(v)}\Big) \mathrm{d} t +\sum_{n} \log \left(\frac{\Gamma_{k^{(n)} \rightarrow k^{(n+1)}}^{(v)}}{\Gamma_{k^{(n)} \rightarrow k^{(n+1)}}}\right) \\
		&-\log \left(\frac{\varphi(k^{(N)})}{\varphi(k^{(0)})}\right)\Bigg]-E_{0} T
	\end{aligned}
\end{equation}
\begin{equation}
\begin{aligned}
D_{\mathrm{KL}}\left(\mathbb{P}_{v} \| \mathbb{P}_{\mathrm{FK}}\right) = \underset{\mathbb{P}_{v}}{\mathbb{E}}\Bigg[\int V(k(t))+\sum_{l \neq k(t)}\big(\Gamma_{k(t) \rightarrow l}&-\Gamma_{k(t) \rightarrow l}^{(v)}\big)+\Gamma_{k(t) \rightarrow l}^{(v)} \log \left(\frac{\Gamma_{k(t) \rightarrow l}^{(v)}}{\Gamma_{k(t) \rightarrow l}}\right) \mathrm{d} t\\
&-\log \left(\frac{\varphi(k^{(N)})}{\varphi(k^{(0)})}\right)\Bigg]-E_{0} T,
\end{aligned}
\end{equation}
which agrees with Todorov.


%---------------------------Maximum Angle-----------------------------
\section{Maximum Angle\label{s:tri-max-angle}}

The maximum included angle of the triangle is
\[
  q =
    \max_{n\in\{0,1,2\}}\left\{\arccos{\left(
      \frac{\vec L_n\cdot\vec L_{n+1}}{\normvec{ L_n}\normvec{ L_{n+1}}}
    \right)}\left(\frac{180\dgr}{\pi}\right)\right\}
\]
measured in degrees.

Note that if any edge vector has zero length, \verd\ will return $q = 0\dgr$.

\trimetrictable{maximum included angle}%
{$A^1$}%                                              Dimension
{$[60\dgr,90\dgr]$}%                                  Acceptable range
{$[60\dgr,180\dgr]$}%                                 Normal range
{$[0\dgr,180\dgr]$}%                                  Full range
{$60\dgr$}%                                           Unit equilateral triangle value
{--}%                                                 Reference(s)
{v\_tri\_maximum\_angle}%                             Verdict function name


\section{High-Degree Indicator Matrix}
\SecLabel{hdim}

In~\cite{LeoRE} Perrin and Biryukov suggested looking at the visual representation of the LAT of an S-Box with the goal of finding non-random patterns. The suggested representation is a heatmap of the LAT matrix and was named "a Jackson Pollock representation" of the LAT, after the famous abstract expressionist painter. The success of this method is illustrated in this chapter.

Consider a 4- and 5-round Feistel Network. For a tiny branch size (for example, 3 bits) it is possible to generate the whole codebook and compute the LAT and its visualization. Figure~\Ref{fig:lat8motiv} shows the Pollock representations of the LAT of Feistel Networks with randomly generated bijective round functions with 3-bit branches (6-bit block size), taken modulo 8.

\FigTex{lat-mod-4.tex}

The images yield a lot of patterns. The patterns are even more clear when observed on multiple random instances of the Feistel Network. In particular, the 4-round structure always yields LAT consisting of $8\times8$ single-colored squares. The 5-round structure still has a visible square structure, but not all squares are single-colored. The topmost leftmost square is always white, the topmost (resp. leftmost) squares consist of horizontal (resp. vertical) lines. Furthermore, linear patterns can be noticed: many columns/rows are inverted versions of other columns/rows, and many columns/rows can be expressed as sums of other columns/rows (modulo 8). The 6-round structure still has linear patterns but no clear squared structure.

After studying these patterns, we observed that the LAT modulo 8 is a bilinear form directly related to the monomials of degree $n-1$ in the ANF of the analyzed $n$-bit permutation. This is formally stated and proved in the following section.

% ======================================

\subsection{Relation between HDIM, LAT and ANF}

\begin{definition}[HDIM]
Let $S\colon \field{n} \to \field{m}$ and $\deg{S}\le n-1$. The HDIM of $S$ is the $m\times n$ matrix $\HDIM{S}$ over $\field{}$ given by
$$
\HDIM{S}[i,j] \eqdef \bigoplus_{x \in \field{n}} \inprod{e_i, S(x)}\inprod{e_j, x}.
$$
\end{definition}

\begin{proposition}[HDIM and ANF]
\Label{hdim-anf}
$\HDIM{S}[i,j] = 1$ if and only if the ANF of the $i$-th coordinate of $S$ contains the monomial $\prod_{k \ne j}x_k=x_1\ldots x_n/x_j$.
\end{proposition}
\begin{proof}
The sum over $\field{n}$ is equal to 1 if and only if the summed expression contains the monomial $x_1\ldots x_n$. Since no coordinate of $S$ has term of degree $n$, $\HDIM{S}[i,j] = 1$ is equivalent to $\inprod{e_i,S(x)}$ having the monomial $x_1\ldots x_n/x_j$.
\end{proof}

Proposition~\Ref{hdim-anf} shows that a known value of a cell of the HDIM corresponds to a known ANF coefficient, i.e. an integral distinguisher. The following theorem describes the relation between the HDIM and the LAT of a function.

\begin{theorem}[HDIM and LAT]
Let $S\colon \field{n} \to \field{m}, n \ge 3$ be a balanced function. Then
$$(\LAT{S}(a,b) \mod{8})/4 = b^\top \times \HDIM{S} \times a.$$
\end{theorem}
\begin{proof}
By linearity of the inner product,
$$
b^\top \times \HDIM{S} \times a = \bigoplus_{x\in \field{n}} \inprod{b,S(x)}\inprod{a,x}.
$$
On the other hand, using $(-1)^z = 1-2z$ for $z\in\field{}$ we obtain:
$$
\LAT{S}(a,b) =
\sum_{x\in \field{n}}(-1)^{\inprod{a,x} \oplus \inprod{b,S(x)}} =
\sum_{x\in \field{n}} (1-2\inprod{a,x})(1-2\inprod{b,S(x)}).
$$
Observe that
$$
\sum_{x\in\field{n}}\inprod{a,x} = 2^{n-1} = \sum_{x\in\field{n}}\inprod{b,S(x)},
$$
where the last equality holds because $S$ is balanced.
It follows that
$$
\LAT{S}(a,b) =
4\sum_{x\in\field{n}}\inprod{a,x}\inprod{b,S(x)} - 2^n
$$
and, for $n \ge 3$, $\LAT{S}(a,b) \equiv 4\sum_{x\in \field{n}}\inprod{a,x}\inprod{b,S(x)}\pmod{8}$.
\end{proof}

The HDIM serves as an interesting link between the algebraic normal form and the linear approximation table of a function. It captures all the information in the LAT modulo 8 and explains the (bi)linear patterns. However, the square patterns in \FigRef{lat8motiv} are artifacts of the 3- and 4-round Feistel Network structure. These patterns have a simple expression in terms of the HDIM. They will be formalized and proved in \SecRef{hdim-feistel}.

\Todo{algorithm for HDIM $\OO(n2^n)$}

% ======================================

\subsection{Properties of the HDIM}

The HDIM inherits some properties from the LAT. In particular, taking the inverse of a permutation or composing a function with affine mappings has a simple effect on the HDIM.

\begin{proposition}
Let $S$ be a permutation of $\field{n}$. Then $$\HDIM{S^{-1}} = \HDIM{S}^{\top}.$$
\end{proposition}
\begin{proof}
It follows from the fact that $\LAT{S^{-1}} = \LAT{S}^{\top}$.
\end{proof}

\begin{proposition}
\Label{prop:hdim-linear-effect}
Let $S\colon \field{n} \to \field{m}$, and let $\mu$ and $\eta$ be linear permutations of $\field{n}$ and $\field{m}$ respectively. Let $T=\eta \circ S \circ \mu$. Then
$$
\HDIM{T} = \eta \times \HDIM{S} \times (\mu^{\top})^{-1}.
$$
\end{proposition}
\begin{proof}
\begin{align*}
\HDIM{T}[i,j] & = e_i^{\top} \times \HDIM{T} \times e_j = \\
& = \bigoplus_{x\in \field{n}} \inprod{e_i,\eta(S(\mu(x)))} \inprod{e_j,x} = \\
& = \bigoplus_{z\in \field{n}} \inprod{e_i,\eta(S(z))} \inprod{e_j,\mu^{-1}\times z} = \\
& = \bigoplus_{z\in \field{n}} \inprod{\eta^{\top}\times e_i,S(z)} \inprod{(\mu^{\top})^{-1}\times e_j, z} = \\
& = (e_i^{\top} \times \eta) \times \HDIM{S} \times ((\mu^{\top})^{-1} \times e_j).
\end{align*}
The proposition follows.
\end{proof}

% ======================================

\subsection{Generalization of the LAT-ANF link}
\SecLabel{gen-lat-anf}

For the rest of the chapter, the link between the HDIM and the LAT will not be used. However, I would like to note a generalization of this link for congruences of the LAT modulo higher powers of 2, for example, modulo 16, 32, etc. The link connects \emph{sums} of the Walsh transform over subspaces with ANF coefficients of lower degree. It is based on the following theorem that relates the sum of a Boolean function $f$ over a linear subspace $V\subseteq\field{n}$ with the sum of the Walsh transform of $f$ over the orthogonal complement of $V$. The first quantity is directly related to the ANF of $f$.

\begin{theorem}[Poisson Summation,{\cite[p.147]{LehmerPoisson}}]
Let $f\colon \field{n} \to \field{}$ and let $V\subseteq \field{n}$ be a linear subspace. Then
$$
\sum_{a \in V}\walsh{f}(a) = 2^n-2^{\dim{V}+1}\sum_{x \in V^{\bot}}f(x).
$$
\end{theorem}
\begin{proof}
Observe that
$$
\sum_{a \in V}\walsh{f}(a) =
\sum_{a \in V}\sum_{x \in \field{n}}(-1)^{\inprod{a,x}\oplus f(x)} =
\sum_{x \in \field{n}}(-1)^{f(x)} \sum_{a \in V} (-1)^{\inprod{a,x}}.
$$
If $x \in V^{\bot}$, then $\sum_{a\in V}(-1)^{\inprod{a,x}}=|V|$. Otherwise, $\inprod{a,x}=1$ exactly for half of $V$ and therefore, $\sum_{a\in V}(-1)^{\inprod{a,x}}=0$. It follows that
$$
\sum_{a \in V}\walsh{f}(a) =
|V|\sum_{x \in V^{\bot}}(-1)^{f(x)} =
|V|\pround{|V^{\bot}|-2\sum_{x \in V^{\bot}}f(x)} =
2^n-2^{\dim{V}+1}\sum_{x \in V^{\bot}}f(x).
$$
\end{proof}

\begin{corollary}
Let $f\colon \field{n} \to \field{}$ be balanced. For any linear subspace $V \subseteq \field{n}$
$$
2^n - \sum_{a \in V}\walsh{f}(a)
\equiv
2^{\dim{V}+1} \pround{\bigoplus_{x\in \field{V^{\bot}}} f(x)} \pmod{{2^{\dim{V}+2}}}.
$$
In particular, the link between the LAT and the ANF established using HDIM follows for $n\ge 3$:
$$
\pround{\walsh{f}(e_j) \mod{8}}/4 = \bigoplus_{x \in \field{n},\inprod{e_j,x}=0} f(x),
$$
where the last expression is the ANF coefficient of the monomial $x_1\ldots x_n/x_j$.
\end{corollary}

\begin{example}
Consider the monomial $x^u = x_3x_4\ldots x_{n}$ of degree $n-2$. The corresponding coefficient $a_u$ in the ANF of $f$ can be expressed as (for $n \ge 4$):
$$
a_u = \frac{1}{8}\proundd{\pround{
\walsh{f}(e_{1})+\walsh{f}(e_{2})+\walsh{f}(e_{1}+e_{2})
} \mod{16}}.
$$
\end{example}

\Todo{check with code}

% ======================================

\subsection{Generalization of the HDIM-ANF link}
\SecLabel{gen-hdim-anf}

The HDIM-ANF link provides an expression for a coefficient of the monomial $x_1\ldots x_n/x_j$ in the ANF of a balanced Boolean function $f\colon \field{n} \to \field{}$,
$$
a_u = \bigoplus_{x \in \field{n}} f(x) \cdot \inprod{e_j, x},
$$
where $1 \le j \le n$ and $u \in \field{n}$ is such that $u_i = 1$ if and only if $i \ne j$. This idea can be generalized for monomials of lower degrees:

\begin{proposition}
\PropLabel{anf-alternative}
Let $f\colon \field{n} \to \field{}$ and $u \in \field{n}$. Then the coefficient $a_u$ of the monomial $x^u \eqdef x_1^{u_1}\ldots x_n^{u_n}$ can be computed as:
$$
a_u = \bigoplus_{x \in \field{n}} f(x) \cdot (\lnot x)^{\lnot u},
$$
where $(\lnot x)^{\lnot u} \eqdef (x_1 \oplus 1)^{u_1 \oplus 1}\ldots (x_n \oplus 1)^{u_n \oplus 1}$.
\end{proposition}
\begin{proof}
The term $(\lnot x)^{\lnot u}$ is equal to one if and only if $x_i = 0$ for all $i$ such that $u_i = 0$, or, equivalently, $x \preceq u$. It follows that the equation from the proposition is equivalent to
$$
a_u = \bigoplus_{x\preceq u} f(x),
$$
which is exactly the expression of the ANF coefficient $a_u$ obtained from the \Mobius{} inversion formula.
\end{proof}

\begin{remark}
The Boolean function $f$ can be replaced by a coordinate $\inprod{e_i, S}$ of vectorial Boolean function $S$.
\end{remark}

\begin{remark}
The HDIM expression involves $\inprod{x, e_i} = x^e_i = x^{\lnot u}$. Since $f$ is balanced (i.e. \txor{}s to zero), it is indeed equivalent to $(\lnot x)^{\lnot u}$. For degrees lower than $n-1$, this is not true in general.
\end{remark}

The generalization of the HDIM-ANF link can be used to directly prove a useful general composition bound by Boura and Canteaut~\cite[Corollary~2]{influence}.

\begin{proposition}
\PropLabel{deficiency}
Let $F$ be a permutation of $\field{n}$ and let $g\colon \field{n} \to \field{}$. Then
$$
\deg{g\circ F} \le n - \ceil{\frac{n- \deg{g}}{\deg{F^{-1}}}}.
$$
\end{proposition}
\begin{proof}
By \PropRef{anf-alternative}, the coefficient $a_u$ of the monomial $x^u$ in the ANF of $g \circ F$ can be computed as
$$
a_u = \bigoplus_{x\in \field{n}} g(F(x)) \cdot (\lnot x)^{\lnot u} = \bigoplus_{z \in \field{n}} g(z) \cdot (\lnot F^{-1}(z))^{\lnot u}.
$$
If follows that $a_u = 0$ if
$$
\deg{\pround{g(z) \cdot (\lnot F^{-1}(z))^{\lnot u}}} < n,
$$
which is definitely true if
$$
\deg{g} + (n - \wt(u)) \cdot \deg{F^{-1}} < n.
$$
Equivalently, $a_u = 0$ if
$$
\wt(u) > n - \frac{n-\deg{g}}{\deg{F^{-1}}}.
$$
It follows that
$$
\deg{g\circ F} \le n - \frac{n-\deg{g}}{\deg{F^{-1}}} \le n - \ceil{\frac{n-\deg{g}}{\deg{F^{-1}}}}.
$$

I remark that strict inequality from Corollary~2 from~\cite{influence} is equivalent to this inequality by switching the rounding up to the rounding down.
\end{proof}