Hamiltonian Neural Networks with Automatic Symmetry Detection
Recently, Hamiltonian neural networks (HNN) have been introduced to
incorporate prior physical knowledge when learning the dynamical equations of
Hamiltonian systems. Hereby, the symplectic system structure is preserved
despite the data-driven modeling approach. However, preserving symmetries
requires additional attention. In this research, we enhance HNN with a Lie
algebra framework to detect and embed symmetries in the neural network. This
approach allows to simultaneously learn the symmetry group action and the total
energy of the system. As illustrating examples, a pendulum on a cart and a
two-body problem from astrodynamics are considered.
Eva Dierkes, Christian Offen, Sina Ober-Blöbaum, Kathrin Flaßkamp
# Hamiltonian Neural Networks with Automatic Symmetry Detection

###### Abstract

Recently, Hamiltonian neural networks (HNN) have been introduced to incorporate prior physical knowledge when learning the dynamical equations of Hamiltonian systems. Hereby, the symplectic system structure is preserved despite the data-driven modeling approach. However, preserving symmetries requires additional attention. In this research, we enhance the HNN with a Lie algebra framework to detect and embed symmetries in the neural network. This approach allows to simultaneously learn the symmetry group action and the total energy of the system. As illustrating examples, a pendulum on a cart and a two-body problem from astrodynamics are considered.

Hamiltonian Neural Networks, Hamiltonian Neural Networks, Hamiltonian Neural Networks, Hamiltonian systems
tonian along with a spanning set of generators of invariant vector fields and testing via a loss function whether the derivatives of the Hamiltonian \(H\) along the invariant vector fields vanish. Utilising Noether's theorem, the two ingredients, symmetries and symplectic structure, then allow us to identify integrals of motions. We exemplify the concept by the cart-pendulum and the two-body example, for which we train a symmetry-symplecticity-preserving neural network.

## II Preliminaries

To introduce notation and our main examples, we summarize preliminaries from the referred research fields, namely geometric mechanics with symmetries and neural network learning. We refer to Marsden and Abraham (1978); Marsden and Ratiu (1999); Olver (1986); Goodfellow, Bengio, and Courville (2016) for details.

### Symplectic maps and Hamiltonian dynamics

Let \(Q\) denote an open, non-empty subset of \(\mathbb{R}^{n}\), which we refer to as _configuration space_. The cotangent bundle \(\mathcal{M}=T^{*}Q\) can be identified with an open subset of \(\mathbb{R}^{2n}\cong\mathbb{R}^{n}\times\mathbb{R}^{n}\) with (Darboux) coordinates \(z=(q,p)\in\mathcal{M}\). The manifold \(\mathcal{M}\) is called _phase space_. A diffeomorphism \(\Psi\colon\mathcal{M}\to\mathcal{M}\) is _symplectic_, if \(\mathrm{D}\Psi(z)^{\top}\mathrm{D}\Psi(z)=J\) for all \(z\in\mathcal{M}\), where \(\mathrm{D}\Psi(z)\) is the Jacobi matrix of \(\Psi\) at \(z\) and

\[J=\begin{pmatrix}0&-I_{n}\\ I_{n}&0\end{pmatrix}\in\mathbb{R}^{2n}\]

is the symplectic structure matrix of \(\mathcal{M}\). Here, \(I_{n}\) denotes the \(n\)-dimensional identity matrix.

Symplectic maps on \(\mathcal{M}\) can be constructed as cotangent lifts of diffeomorphisms and as flows of Hamiltonian vector fields: given a diffeomorphism \(\phi\colon\mathcal{Q}\to Q\) we can obtain a symplectic map \(\Psi\colon\mathcal{M}\to\mathcal{M}\) as \(\Psi(q,p)=(\phi^{-1}(q),\mathrm{D}\phi(q)^{\top}p)\). The map \(\Psi\colon\mathcal{M}\to\mathcal{M}\) is called _the cotangent lift of \(\phi\)_.

For any scalar valued map \(H\colon\mathcal{M}\to\mathbb{R}\) we consider the _Hamiltonian vector field_\(X_{H}(z)=J^{-1}\nabla H(z)\). _Hamilton's equations_ are given as the flow equations to \(X_{H}\), i.e.

\[\dot{z}=X_{H}(z)=J^{-1}\nabla H(z)\quad\text{or}\quad\begin{cases}\dot{q}&= \nabla_{p}H(q,p)\\ \dot{p}&=-\nabla_{q}H(q,p)\end{cases}. \tag{1}\]

For \(\tau\in\mathbb{R}\), the flow map \(\Psi_{\tau}\) assigns to \(z_{0}\in\mathcal{M}\) the solution of (1) at time \(\tau\) subject to the initial condition \(z(0)=z_{0}\) (if it exists). On its domain of definition \(\mathcal{M}_{\tau}\subset\mathcal{M}\), the map \(\Psi_{\tau}\colon\mathcal{M}_{\tau}\to\Psi_{\tau}(\mathcal{M})\) is symplectic. Symplectic maps on \(\mathcal{M}\) form a group under composition which we denote by \(\mathrm{Symp}(\mathcal{M})\).

### Lie group actions

Let us briefly introduce Lie group actions and invariant vector fields. For details we refer to Marsden and Ratiu (1999).

Lie groups are algebraic groups which are also smooth manifolds. For a Lie group \(G\), the Lie algebra \(\mathfrak{g}\) is the tangent space of \(G\) at the neutral element \(e\), i.e., for

\[\mathfrak{g}=\left\{v=\left.\frac{\mathrm{d}}{\mathrm{d}t}\right| _{t=0}\gamma(t)\right| \gamma: \left(-\varepsilon,\varepsilon\right)\to G\text{ smooth}\] \[\text{with }\gamma(0)=e,\,\varepsilon>0\right\}.\]

Denote by \(\exp\colon\mathfrak{g}\to G\) the _exponential map_: in case \(G\) is a subgroup of the group of invertible matrices \(\mathrm{GL}(\mathbb{R},n)=\{A\in\mathbb{R}^{n\times n}|\det(A)\neq 0\}\), the map \(\exp\) is given by the matrix exponential.

A _Lie group action_ on a manifold \(\mathcal{M}\) is a group homomorphism \(L\colon G\to\mathrm{Diff}(\mathcal{M}),\,\mathfrak{g}\mapsto L_{g}\), i.e. for all \(g,h\in G\) the map \(L_{g}\colon\mathcal{M}\to\mathcal{M}\) is a diffeomorphism and \(L_{g\in h}=L_{g}\circ L_{h}\). If the manifold \(\mathcal{M}\) is symplectic and each \(L_{g}\) is a symplectic map, then the Lie group action is called _symplectic_.

To each Lie algebra element \(v\in\mathfrak{g}\) we associate the _fundamental vector field_\(\widehat{v}\) defined by

\[\widehat{v}_{z}=\left.\frac{\mathrm{d}}{\mathrm{d}t}\right|_{t=0}L_{\exp(rv)}( z)\in T_{z}\mathcal{M},\quad z\in\mathcal{M}.\]

These vector fields can be thought of as infinitesimal actions of the Lie group \(G\) on \(\mathcal{M}\).

Of central importance for the applications considered in this article are actions of subgroups of the group of affine linear transformations, which are introduced in the following.

**Example II.1** (Affine linear transformations).: Let \(Q=\mathbb{R}^{n}\) and \(\mathcal{M}=T^{*}Q\cong\mathbb{R}^{2n}\) with Darboux coordinates \((q,p)\). The group of affine transformations \(G=\mathrm{Aff}(Q)\) on \(Q\) can be represented as

\[G=\mathrm{Aff}(Q)=\left\{\begin{pmatrix}A&b\\ 0&1\end{pmatrix}\right|A\in\mathrm{Gl}(\mathbb{R},n),\,b\in\mathbb{R}^{n} \right\},\]

where the group operation is matrix multiplication and \(\mathrm{Gl}(\mathbb{R},n)\) denotes the group of invertible matrices. Its Lie algebra is

\[\mathfrak{g}=\mathrm{aff}(Q)=\left\{\begin{pmatrix}M&b\\ 0&0\end{pmatrix}\right|M\in\mathbb{R}^{n\times n},\,b\in\mathbb{R}^{n}\right\}.\]

As a shorthand for \(\begin{pmatrix}A&b\\ 0&1\end{pmatrix}\in G\) and for \(\begin{pmatrix}M&b\\ 0&0\end{pmatrix}\in\mathfrak{g}\) we may write \((A,b)\in G\) or \((M,b)\in\mathfrak{g}\), respectively. Later, it will be handy to consider \(\mathfrak{g}=\mathrm{aff}(Q)\) as an inner product space. For this we can consider the inner product

\[\begin{split}\langle v^{(1)},v^{(2)}\rangle_{\mathrm{aff}(Q)}& =\langle(M^{(1)},b^{(1)}),(M^{(2)},b^{(2)})\rangle_{\mathrm{aff}(Q)}\\ &=\langle M^{(1)},M^{(2)}\rangle+\langle b^{(1)},b^{(2)}\rangle\end{split} \tag{2}\]

for \(v^{(j)}=(M^{(j)},b^{(j)})\in\mathfrak{g}\). Here \(\langle M^{(1)},M^{(2)}\rangle\) denotes the Frobenius inner product \(\langle M^{(1)},M^{(2)}\rangle=\sum_{i,j=1}^{n}M^{(1)}_{ij}M^{(2)}_{ij}\) on
\(\mathbb{R}^{n\times n}\) and \(\langle b^{(1)},b^{(2)}\rangle\) the Eucledian inner product on \(\mathbb{R}^{n}\). This definition of \(\langle v^{(1)},v^{(2)}\rangle_{\text{aff}(Q)}\) corresponds to the Frobenius inner product of the matrices \(\begin{pmatrix}M^{(1)}&b^{(1)}\\ 0&0\end{pmatrix},\begin{pmatrix}M^{(2)}&b^{(2)}\\ 0&0\end{pmatrix}\in\mathbb{R}^{(n+1)\times(n+1)}\). The induced norm on \(\mathfrak{g}\) is given as \(\|v\|_{\text{aff}(Q)}=\langle v,v\rangle_{\text{aff}(Q)}\) for \(v\in\mathfrak{g}\)

The exponential map \(\exp\colon\mathfrak{g}\to G\) is given as the matrix exponential. The group \(G\) acts on \(Q\) by affine linear transformations \((A,b)\mapsto\ell_{(A,b)}\) with \(\ell_{(A,b)}(q)=Aq+b\). Furthermore, the group \(G\) acts on \(\mathcal{M}=T^{*}Q\) symplectically with \((A,b)\mapsto L_{(A,b)}\) where \(L_{(A,b)}\colon\mathcal{M}\to\mathcal{M}\) is the contangent lift of \(\ell_{(A,b)}\colon\mathcal{Q}\to Q\), i.e.

\[L_{(A,b)}(q,p)=\left(A^{-1}(q-b),\ A^{\top}p\right).\]

For \(v=(M,b)\in\mathfrak{g}\) the invariant vector field \(\widehat{v}=\widehat{(M,b)}\) at \((q,p)\in\mathcal{M}\) is given as

\[\widehat{v}_{(q,p)}=\widehat{(M,b)}_{(q,p)}=\left(-Mq-b,\ M^{\top}p\right).\]

Vector fields can be interpreted as derivations: if \(\widehat{v}=\widehat{(M,b)}_{(q,p)}\) is applied to \(H\colon\mathcal{M}\to\mathbb{R}\) we obtain the directional derivative

\[\widehat{v}_{(q,p)}(H) =\widehat{(M,b)}_{(q,p)}(H)\] \[=(-Mq-b)^{\top}\nabla_{q}H(q,p)+(M^{\top}p)^{\top}\nabla_{p}H(q,p). \tag{3}\]

### Symmetry actions and conserved quantities

Consider a Hamiltonian \(H\colon\mathcal{M}\to\mathbb{R}\) on the symplectic manifold \(\mathcal{M}=T^{*}Q\), where \(Q\) is an open, non-empty subset of \(\mathbb{R}^{n}\). A symplectic Lie group action \(L\colon G\to\text{Symp}(\mathcal{M})\) is a _symmetry_ if \(H\circ L_{g}=H\) for all \(g\in G\). This has important consequences for the dynamical system defined by the Hamiltonian vector field \(X_{H}\): if \(\gamma\colon[a,b]\to\mathcal{M}\) is a motion, i.e. \(\gamma\) fulfills Hamilton's equations (1), then \(L_{g}\circ\gamma\) is a motion as well. Moreover, if \(v\in\mathfrak{g}\) such that \(\widehat{v}\) is the Hamiltonian vector field to a smooth map \(I\colon\mathcal{M}\to\mathbb{R}\) then \(I\) is a conserved quantity of the system, i.e. \(I\circ\gamma=I\) for all motions \(\gamma\) (Noether's theorem).

**Example II.2**.: If a Hamiltonian \(H\) is invariant under a translation in the direction of \(b\in\mathbb{R}^{n}\), i.e. the directional derivative \(\nabla_{(b,0)}H(q,p)=\sum_{j=1}^{n}b^{j}\frac{\partial H}{\partial q^{j}}(q,p)\) vanishes for all \((q,p)\in\mathcal{M}\), then the quantity \(I(q,p)=b^{\top}p\) is conserved under motions. More generally, if \((M,b)\in\mathfrak{g}\) is an element of the Lie algebra of affine linear transformations and \(\widehat{(M,b)}_{(q,p)}(H)=0\) for all \((q,p)\in\mathcal{M}\) (see (3)) then

\[I(q,p)=p^{\top}(-Mq-b) \tag{4}\]

is a conserved quantity.

**Remark II.1**.: If for a Lie group action on a Hamiltonian system with Hamiltonian \(H\) the fundamental vector fields \(\widehat{v}^{\dagger},\widehat{v}^{2}\) to Lie algebra elements \(v^{\dagger},v^{2}\in\mathfrak{g}\) generate infinitesimal symmetries, i.e. \(\widehat{v}^{\dagger}(H)=0\) and \(\widehat{v}^{2}(H)=0\), then, the commutator of the vector fields \([\widehat{v}^{\dagger},\widehat{v}^{2}]\) is the fundamental vector field to a Lie algebra element \([v^{1},v^{2}]\in\mathfrak{g}\) and \(\widehat{[v^{1},v^{2}]}(H)=0\).

The following Examples II.3 and II.4 introduce the two main examples to which we will apply our framework.

**Example II.3** (Pendulum on a cart).: The proposed framework will be applied to the example of a planar pendulum mounted on a cart (cf. e.g. Bloch, 2003). The generalized coordinates are \(q=(s,\varphi)\), where \(s\) is the position of the cart and \(\varphi\) is the angle to the upper vertical of the pendulum. Since this system is well studied, we can use the true Hamiltonian for, firstly, generating data points and, secondly, evaluating the performance of our data-based approach. The Hamiltonian is given by

\[H(\varphi,p_{s},p_{\varphi})=\frac{ap_{s}^{2}+2bp_{s}p_{\varphi}\cos\varphi+ c\varphi_{\varphi}^{2}}{2ac-b^{2}\cos^{2}\varphi}-D\cos\varphi, \tag{5}\]

with the constants \(a=ml^{2}\), \(b=ml\), \(c=m_{0}+m\) and \(D=-mgl\). Here \(l\) is the length and \(m\) the mass of the pendulum, \(m_{0}\) corresponds to the mass of the cart and \(g=9.81\) is the gravitation constant. In our numerical experiments \(m=m_{0}=l=1\).

The Hamiltonian \(H\) does not explicitly depend on the cart's position \(s\). Therefore, \(H\) is invariant under translations in \(s\), i.e. the symplectic transformations \((s,\varphi,p_{s},p_{\phi})\mapsto(s+b_{1},\varphi,p_{s},p_{\phi})\) for all \(b_{1}\in\mathbb{R}\). This can be interpreted as actions by the following subgroup of \(\text{Aff}(Q)\) (see Example II.1):

\[G=\left\{(I_{2},b)=\begin{pmatrix}I_{2}&b\\ 0&1\end{pmatrix}\middle|b=\begin{pmatrix}b_{1}\\ 0\end{pmatrix},b_{1}\in\mathbb{R}\right\}\subset\text{Aff}(Q).\]

Here \(I_{2}\) is the 2-dimensional identity matrix. Its Lie algebra \(\mathfrak{g}\) is given as the following sub-Lie algebra of \(\text{aff}(Q)\)

\[\mathfrak{g}=\left\{\left.(0_{2},b)=\begin{pmatrix}0_{2}&b\\ 0&0\end{pmatrix}\middle|b=\begin{pmatrix}b_{1}\\ 0\end{pmatrix},b_{1}\in\mathbb{R}\right\}\subset\text{aff}(Q). \tag{6}\]

Here \(0_{2}\) is the 2-dimensional zero matrix. We have \(\widehat{v}(H)=\overline{(0_{2},(0,s)^{\top})}(H)=-s\frac{\partial H}{ \partial s}=0\) for all \(v\in\mathfrak{g}\) (see (3)). It follows that \(I(s,\phi,p_{s},p_{\phi})=-p_{s}\) is a conserved quantity.

**Example II.4** (Two-body Example).: Another example is a point mass orbiting a fixed point, e.g. a satellite rotating about a planet. We consider this example in Cartesian coordinates, with the origin of the coordinate frame in the center of the bigger point mass (e.g. the planet). The true Hamiltonian is given by

\[H(x,y,p_{x},p_{y})=\frac{1}{2}p^{\top}M^{-1}p-\frac{k}{\|q\|}, \tag{7}\]

with \(q^{\top}=\begin{pmatrix}x,&y\end{pmatrix}\) the position of the small mass (satellite) and \(p^{\top}=\begin{pmatrix}p_{x}&p_{y}\end{pmatrix}\) the corresponding conjugate momenta,
\(m\cdot I_{2}\) the mass matrix and \(k\) the gravitation constant. In our numerical examples \(m=1\) and \(k\approx 1016.895\).

Symmetry transformations for the two-body example are given by rotations around the origin, i.e. \((q,p)\mapsto(A^{\top}q,A^{\top}p)\) for a matrix \(A\in SO(2)=\{A\in\text{GI}(2,\mathbb{R})\,|\,A^{\top}A=I_{2},\det(A)=1\}\). These transformations can be interpreted as actions by the following subgroup of \(\text{Aff}(Q)\) (see Example II.1):

\[G= \left\{(A,0)=\begin{pmatrix}A&0\\ 0&1\end{pmatrix}\right|A\in\mathbb{R}^{2\times 2},A^{\top}A=I_{2},\det(A)=1\right\}\] \[\subset\text{Aff}(Q).\]

Its Lie algebra \(\mathfrak{g}\) is given as the following sub-Lie algebra of \(\text{aff}(Q)\)

\[\mathfrak{g}=\left\{(M,0)=\begin{pmatrix}M&0\\ 0&0\end{pmatrix}\right|M\in\mathbb{R}^{2\times 2},M^{\top}=-M\right\}\subset \text{aff}(Q).\]

For \((M,0)\in\mathfrak{g}\) the fundamental vector field is given as \(\widetilde{(M,0)}_{q,p}=(-Mq,M^{\top}p)\) and we have \(\widetilde{(M,0)}_{q,p}(H)=(-Mq)^{\top}\nabla_{\mathfrak{g}}H(q,p)+(M^{\top} p)^{\top}\nabla_{p}H(q,p)=0\). This implies that \(I(q,p)=-p^{\top}Mq\) is a conserved quantity for the dynamics for all \(M\in\text{so}(2)\). Here, \(\text{so}(2)\subset\mathbb{R}^{2\times 2}\) is the Lie algebra to \(SO(2)\). It consists of all skew symmetric \(2\times 2\) matrices.

### Deep Learning for structure-preserving system identification

Deep learning methods are widely used for data-based identification tasks. We introduce the basic concepts needed for our framework and refer to Goodfellow, Bengio, and Courville (2016) as a detailed textbook on deep learning for further information.

A neural network is a network of artificial neurons, which are connected by affine linear transformations connected with (nonlinear) activation functions. The neurons can be represented as nodes and are grouped into layers. There always is an input layer, whose shape is defined by the data set, and an output layer, whose shape is defined by the task to be learned. Between those two layers, the user can introduce any number of hidden layers.

For feedforward networks, the connections are only in the direction of the output layer, i.e. no backward connection and no connection within a layer are allowed. Due to the nesting of the nodes, arbitrary functions can be approximated (see Hornik, Stinchcombe, and White, 1989). The network parameters \(\theta\), given by the connection of nodes, are fitted during the learning process to minimize a user defined _loss function_, usually using a variant of gradient descent method. The loss function defines the learning task. In the case of data fitting, a variant of the mean-squared error (MSE) between the data set and the model output is often used.

Physics-based learning (as proposed by Raissi, Perdikaris, and Karniadakis (2019)) was introduced to enhance neural networks with physical properties. Here, the loss function represents the known physics of the system, and the model output are the parameters to be learned. For this approach, a physical representation needs to be known.

If only a more general system structure is known beforehand, this structure can be preserved by special formulations of the loss function. As a part of physics-informed learning, Lagrangian neural networks (LNN) by Cranmer _et al._ (2020) and Hamiltonian neural networks (HNN) by Greydanus, Dzamba, and Yosinski (2019) aim to preserve the underlying system structure. This is achieved by learning the Lagrangian or Hamiltonian function of the system from data without assumptions on the specific form of the function. This needs to be contrasted to learning the vector field or flow map of the system directly, which does not enforce physical structure on the learned system.

Our proposed approach is based on HNN, which proposes to learn a Hamiltonian \(H\colon\mathcal{M}\to\mathbb{R}\) modeled as a neural network based on observations \((\hat{z}^{(k)})_{k=1}^{N}\) of a Hamiltonian vector field \(X_{H}\in\mathfrak{X}(\mathcal{M})\) at positions \((z^{(k)})_{k=1}^{N}\subset\mathcal{M}\). The loss function involves the error of the Hamiltonian equation (see (1)) for all observations,

\[\ell_{\text{dynamics}}=\sum_{k=1}^{N}\|\hat{z}^{(k)}-X_{H}(z^{(k)})\|_{T \mathcal{M}}^{2}.\]

The derivatives to obtain \(X_{H}(z^{(k)})\) are computed using algorithmic differentiation (see Griewank and Walther, 2008). Further details and used methods for (stochastic) gradient descent, choices of activation functions and hyperparameter are given in course of studying the numerical examples in Section IV.2.

Based on the HNN approach, Dierkes and Flasskamp (2021) propose to include the known symmetry of the system in the learning of the Hamiltonian. Other works, such as Lishkova _et al._ (2022), are learning an underlying symmetry group alongside a discrete Lagrangian on a single trajectory.

## III Simultaneous learning of symmetry actions and Hamiltonians

Assume we are faced with an identification problem of a dynamical system known to be Hamiltonian and to possess symmetry, but without having knowledge of the symmetry's Lie group action or the corresponding conserved quantity. Then, it is desirable to reveal both, the Hamiltonian dynamics, as well as the symmetry, by data-based learning. For a symplectic action of a group \(G\) on the phase space (such as actions by affine linear transformations, for instance) we propose to learn a basis \(v^{(1)},\dots,v^{(K)}\) of a subspace \(V\) of the Lie algebra \(\mathfrak{g}\) such that actions by elements \(g\in\exp(V)\) are symmetries of the dynamical system. The basis elements \(v^{(1)},\dots,v^{(K)}\) are learned simultaneously with the Hamiltonian \(H\) from observations of the vector field. Here \(K\) is an estimation for the dimension of the subgroup of \(G\) which acts by symmetries. One may start with \(K=1\) (or \(K=0\)) and successively increase \(K\) until either \(K=\dim(G)\) or the minimisation of the loss function introduced in the following fails to fit another symmetry.
An identification of \(V\) also reveals conserved quantities of the dynamical system as outlined in Section II.3.

### Loss function for symmetry terms

Let \(\mathcal{M}^{\circ}\subset\mathcal{M}\) be a section of the phase space \(\mathcal{M}\) containing the parts of interest. \(\mathcal{M}^{\circ}\) is required to be topologically open and its closure to be a compact subset of \(\mathcal{M}\). Let \(\mathrm{dvol}\) denote the volume form on \(\mathcal{M}\), i.e. \(\mathrm{dvol}=\mathrm{d}q^{1}\wedge\mathrm{d}p_{1}\wedge\ldots\wedge\mathrm{ d}q^{n}\wedge\mathrm{d}p_{n}\) if \(\mathcal{M}\) is represented as an open subset of \(\mathbb{R}^{2n}\cong T^{*}\mathbb{R}^{n}\).

For \(k=1,\ldots,K\) the symmetry loss term for each basis element \(v^{(k)}\) is defined by

\[\ell_{\mathrm{sym}}^{(k)}=\frac{1}{\mathrm{dvol}(\mathcal{M}^{\circ})\|v^{(k) }\|}\int_{\mathcal{M}^{\circ}}|\widehat{v}^{(k)}(H)|^{2}\mathrm{dvol}. \tag{8}\]

Here, \(\widehat{v}^{(k)}\) denotes the invariant vector field to \(v^{(k)}\). The term \(\ell_{\mathrm{sym}}^{(k)}\) measures how invariant \(H\) is under actions with group elements of \(\exp(rv^{(k)}|t\in\mathbb{R})\). The factor \(\frac{1}{\mathrm{dvol}(\mathcal{M}^{\circ})\|v^{(k)}\|}\) is a normalisation by the volume of \(\mathcal{M}^{\circ}\) and the norm of \(v\). Equip \(\mathfrak{g}\) with an inner product \(\langle\cdot,\cdot\rangle\) and norm \(\|\cdot\|\). Given weights \(\alpha^{(k)},\beta^{(k)}>0\) the combined symmetry loss function is

\[\ell_{\mathrm{sym}}=\sum_{k=1}^{K}\left(\ell_{\mathrm{sym}}^{(k)}+\alpha^{(k )}\|\|v^{(k)}\|-1\|^{2}+\beta^{(k)}\sum_{s=1}^{k-1}\langle v^{(k)},v^{(s)} \rangle\right). \tag{9}\]

The last two terms of \(\ell_{\mathrm{sym}}\) measure the orthonormality of the spanning set \(v^{(1)},\ldots,v^{(K)}\) while \(\sum_{k=1}^{K}\ell_{\mathrm{sym}}^{(k)}\) measures how well infinitesimal actions by elements of \(V=\mathrm{span}(v^{(1)},\ldots,v^{(K)})\) preserve \(H\).

**Example III.1**.: If we look for a 1-dimensional subgroup of the group of affine linear transformations as in Example II.1, then for the Lie algebra element \(v^{(1)}=(M^{(1)},b^{(1)})\in\mathfrak{g}\) we have

\[\ell_{\mathrm{sym}} =\ell_{\mathrm{sym}}^{(1)}+\alpha^{(1)}\|\|v^{(1)}\|_{\mathrm{ diff}(Q)}-1\|^{2}\] \[=\ell_{\mathrm{sym}}^{(1)}+\alpha^{(1)}\|M^{(1)}\|_{\mathrm{F}}+ \|b^{(1)}\|_{2}-1\|^{2}\]

with Frobenius norm \(\|M^{(1)}\|_{F}\) (see Example II.1) and Euclidean norm \(\|b^{(1)}\|_{2}\) and with

\[\ell_{\mathrm{sym}}^{(1)} =\Theta\int_{\mathcal{M}^{\circ}}\Big{|}(-M^{(1)}q-b^{(1)})^{\top }\nabla_{q}H(q,p) \tag{10}\] \[\qquad\qquad+(M^{(1)^{\top}}p)^{\top}\nabla_{p}H(q,p)\Big{|}^{2} \mathrm{d}q\mathrm{d}p,\]

with normalisation factor \(\Theta=(\mathrm{dvol}(\mathcal{M}^{\circ})\|v^{(1)}\|_{\mathrm{diff}(Q)})^{-1}\) and with \(\mathrm{d}q\mathrm{d}p=\mathrm{d}q^{1}\ldots\mathrm{d}q^{n}\mathrm{d}p_{1}\ldots \mathrm{d}p_{n}\). The elements of \(M^{(1)}\in\mathbb{R}^{n\times n}\) and \(b^{(1)}\in\mathbb{R}^{n}\) are learnable parameters.

If we look for a 2-dimensional subgroup, then

\[\ell_{\mathrm{sym}} =\ell_{\mathrm{sym}}^{(1)}+\ell_{\mathrm{sym}}^{(2)} \tag{11}\] \[+\alpha^{(1)}\|M^{(1)}\|_{\mathrm{F}}+\|b^{(1)}\|_{2}-1\|^{2}\] \[+\alpha^{(2)}\|\|M^{(2)}\|_{\mathrm{F}}+\|b^{(2)}\|_{2}-1\|^{2}\] \[+\beta^{(2)}(\langle M^{(2)},M^{(1)}\rangle+\langle b^{(2)},b^{(1 )}\rangle).\]

Here \(\langle M^{(2)},M^{(1)}\rangle\) is the Frobenius inner product of the matrices \(M^{(2)},M^{(1)}\) (see Example II.1) and \(\langle b^{(2)},b^{(1)}\rangle\) the Euclidean inner product. \(\alpha^{(1)},\alpha^{(2)},\beta^{(2)}>0\) are weights. The symmetry loss \(\ell_{\mathrm{sym}}^{(2)}\) is defined in analogy to \(\ell_{\mathrm{sym}}^{(1)}\). The learnable symmetry parameters are given as \(M^{(1)},M^{(2)}\in\mathbb{R}^{n\times n}\) and \(b^{(1)},b^{(2)}\in\mathbb{R}^{n}\).

### Training

The Hamiltonian \(H\) and the spanning set \(v^{(1)},\ldots,v^{(K)}\) can now be learned using the combined loss function

\[\ell=\ell_{\mathrm{dynamics}}+\gamma\;\ell_{\mathrm{sym}}, \tag{12}\]

where \(H\) is modeled as a neural network, \(v^{(1)},\ldots,v^{(K)}\) are additional free parameters and \(\gamma>0\) is a scaling weight. We denote a model using (12) as a loss function by SymHNN.

Rather than training the network and identifying all symmetry parameters at once, the training can be performed with a low value for \(K\) first. (For \(K=0\) our method corresponds to HNN.) Then \(K\) is increased, and the training is repeated using the pre-trained network and \(v^{(1)},\ldots,v^{(K-1)}\) as priors.

As learning a good Hamiltonian is the primary goal, it is helpful to pre-train the network without the symmetry term first and only learn the symmetry once a good approximation of the data is achieved. Adding the symmetry loss to the overall loss function may lead to high values in the training loss, as the (so far) learned Hamiltonian does not satisfy the symmetry requirement of the random initialized basis element.

The weight \(\gamma>0\) in (12) may vary with the number of epochs trained. Pre-training the neural network without the symmetry loss term to achieve a good approximation of the Hamiltonian seems a reasonable approach. Furthermore, slowly increasing \(\gamma\) over some epochs avoids high jumps in the learning curve, as the optimisation process can adapt the randomly initialized \(v^{(k)}\) to the symmetry of the current learned Hamiltonian first and then slightly modify the Hamiltonian to minimise the symmetry loss. This avoids that the Hamiltonian is driven towards a symmetric function whose symmetry corresponds to the random initialization of \(v^{(k)}\).

The integral in (8) can be approximated by averaging the integrand over a few points in the phase space \(\mathcal{M}^{\circ}\), randomly drawn in each epoch of the minimization procedure with respect to a uniform probability distribution on \(\mathcal{M}^{\circ}\).

### Extensions and further remarks

**Remark III.1**.: As justified by Remark II.1, when in the learning process of Section III.2 Lie algebra elements \(v^{(1)},v^{(2)}\) have been identified, then the Lie bracket \([v^{(1)},v^{(2)}]\) can be used as a prior for \(v^{(3)}\) (unless vanishing or close to zero). Moreover, in any stage of the learning process with \(K\geq 2\) (higher order iterations of) Lie brackets of already identified elements \(v^{(1)},\ldots,v^{(K-1)}\) can be used to obtain initial guesses for \(v^{(K)}\).
**Remark III.2**.: Under mild assumptions, for a Lie group action of a Lie group \(G\) on a symplectic manifold \(\mathcal{M}\) there exists a _momentum map_\(\mu\). To be more precise: Denote the paring of \(\mathfrak{g}\) and its dual space \(\mathfrak{g}^{*}\) by \(\langle\cdot,\cdot\rangle_{\text{pair}}\). The momentum map \(\mu:\mathcal{M}\to\mathfrak{g}^{*}\) is a smooth map defined by \(\mu(0)=0\) and by the relation \(X_{\langle\mu,v\rangle}=\widehat{v}\) for all \(v\in\mathfrak{g}\), where \(\widehat{v}\) denotes the fundamental vector field to \(v\) and \(X_{\langle\mu,v\rangle}\) the Hamiltonian vector field to the function \(\langle\mu,v\rangle:\mathcal{M}\to\mathbb{R}\).

Provided that the learned Hamiltonian \(H\) accurately describes the true Hamiltonian of the system and \(\ell_{\text{sym}}=0\) (see (9)) the learned Lie algebra elements \(v^{(1)},\ldots,v^{(K)}\) found by the described procedure yield the following functionally independent conserved quantities \(\mu^{(j)}=\langle\mu,v^{(j)}\rangle_{\text{pair}}\) of the system's Hamiltonian motions. In the example of affine linear transformations, the expressions \(\mu^{(j)}\) recover the conserved quantities presented in Example II.2.

**Remark III.3**.: Our framework can be generalised directly to general symplectic group actions, i.e. for actions which are not cotangent lifted actions. Indeed, the symplectic manifold \((\mathcal{M},\omega)\) does not need to have the structure of a cotangent bundle.

## IV Numerical results

For the two examples, pendulum on a cart (Example II.3) and 2-body example (Example II.4), numerical results are presented in this section. We use the library _PyTorch_ by Paszke _et al._ (2019) to setup and train our models, the code for the implementation and the experiments can be found on git git@github.com:eva-dierkes/HNN_withSymmetries.git. More details on how we construct data, chose hyperpaemeters of the networks and the results are discussed in the following.

### Generating data for academic examples

In order to generate data to train and test our network, we sample initial points in the area of interest, i.e. \(\mathcal{M}^{\text{o}}\), and simulate each of them with the true dynamics for a short period of time, using a fourth order Runge-Kutta scheme (cf. Runge, 1895) with a low error tolerance of \(1\mathrm{e}-10\). Each point of these trajectories is extended by the vector field evaluation to obtain \((\dot{q},\dot{p})\), and Gaussian noise is added if stated. As our proposed model does not require trajectory input, each data set sample is an individual training/validation/testing example. The data set is split into \(70\,\mathrm{\char 37}\) training, \(15\,\mathrm{\char 37}\) validation, and \(15\,\mathrm{\char 37}\) test data. The choice of \(\mathcal{M}^{\text{o}}\) highly depends on the application, just as the length of the trajectories, the sampling rate, and the number of trajectories.

For the numerical comparison, a dense neural network (BaseNN), without learning the Hamiltonian but directly learning the vector field, and an HNN without symmetry information are trained.

The ground truth solution \(\gamma^{*}\) is generated by integrating a randomly chosen initial point (in the area of interest) with a symplectic midpoint rule (see Haier, Lubich, and Wanner, 2006). For this, the true system, the Hamiltonian, and the symmetry are evaluated. Trajectories that are obtained by symplectic integration are denoted by \(\gamma\). Note that learned models and symmetries are denoted by a subscript \((\cdot)_{\theta}\) or by a label corresponding to the used modeling approach (as BaseNN, HNN or SymHNN), and the ground truth is labeled by a superscript \((\cdot)^{*}\). An overview of the used abbreviations and their explanation can be found in Table 1.

### Net architecture and choice of hyperparameters

The chosen network is a fully connected feedforward network, as proposed by Greydanus, Dzamba, and Yosinski (2019) for the HNN. We take three layers of 256 neurons each; as an activation function, we choose \(\mathrm{Softplus}(x)=\cdot\log(1+\exp(x))\), as it outperformed the use of a hyperbolic tangent.

The _Adam_ optimizer (see Kingma and Ba, 2015) is used to train the models with an initial learning rate of \(5\mathrm{e}-3\). Additionally, a _reduce on plateau_ learning rate scheduler is used, which decreases the learning rate by a factor of \(0.95\) if the Hamiltonian loss \(\ell_{\text{dynamics}}\) does not improve over \(50\,\mathrm{epochs}\) on the validation data set. The learning is performed for \(20\,000\,\mathrm{epochs}\), but stops early if \(\ell_{\text{dynamics}}\) has not decreased on the validation data set over the last \(10\,000\,\mathrm{epochs}\).

For the SymHNN models, the symmetry term is smoothly added to the loss function (as proposed in Section III.2). The first \(100\,\mathrm{epochs}\) are trained without any symmetry term, then for the next \(100\,\mathrm{epochs}\) the weight \(\gamma\) from (12) is linearly increased from \(0\) to \(0.5\).

\begin{table}
\begin{tabular}{l l} \(H^{*}\) & True Hamiltonian, see (5) \\ \(H_{\theta}\) & Learned Hamiltonian \\ \(H_{\text{HNN}}\) & Learned Hamiltonian by an HNN \\ \(H_{\text{SymHNN}}\) & Learned Hamiltonian by a SymHNN \\ \hline \(\gamma^{*}\) & True trajectory; (5) integrated by symplectic midpoint rule \\ \(\gamma_{\theta}\) & Trajectory using a learned model integrated by symplectic midpoint rule \\ \(\gamma_{\text{BaseNN}}\) & Trajectory using a directly learned vector field integrated by symplectic midpoint rule \\ \(\gamma_{\text{HNN}}\) & Trajectory using a HNN and a symplectic midpoint rule \\ \(\gamma_{\text{SymHNN}}\) & Trajectory using a SymHNN integrated by symplectic midpoint rule \\ \hline \(v^{*}\) & True symmetry of the system, see (6) \\ \(v^{*}\)SymHNN & Learned symmetry of the system using a SymHNN \\ \end{tabular}
\end{table}
Table 1: Explanation for the used symbols and abbreviations.
### Pendulum on a cart

Generating a data set for Example II.3, 1000 random initial values with \(|s|<5\), \(|\varphi|<\pi\), \(|p_{s}|<1\) and \(|p_{\varphi}|<\pi\) are generated. Each initial guess is integrated for 3 s with a sampling rate of 15 Hz. Only for data generation a fourth-order Runge-Kutta scheme is used to integrate the (exact) vector field induced by \(H\). To each sample of the resulting data set, Gaussian noise with \(\sigma^{2}=1\mathrm{e}{-2}\) is added.

For the training of our proposed SymHNN we set \(K=1\) and the scaling factors in (9), \(\alpha^{(k)}\) and \(\beta^{(k)}\), are set to 1 for all \(k\).

The resulting trajectories for a long time evaluation \(\gamma\) using a symplectic midpoint rule, are shown in Figure 1 for the (randomly chosen) initial configuration \([q,p]=[0,2.34,0.49,1.54]\). The true Hamiltonian (5), denoted by \(H^{*}\), evaluated for the states of Figure 1 and shifted by the inital value \(H^{*}(\gamma_{\theta}(0))\) is shown in Figure 2. However, since system dynamics depend on derivatives of \(H\) only, the constant offset is irrelevant. The evaluation of \(H\) for the SymHNN trajectory stays almost constant and close to the reference. The Hamiltonian for the BaseNN grows quickly and for the HNN, it swings with a high amplitude.

It should be highlighted that SymHNN learns correctly (up to numerically precision) to choose \(b^{(1)}=[1.0000,-1.0348\mathrm{e}{-05}]\) and

\[M^{(1)}=\begin{pmatrix}-1.21\mathrm{e}{-6}&-1.91\mathrm{e}{-6}\\ 9.30\mathrm{e}{-9}&-4.22\mathrm{e}{-6}\end{pmatrix},\]

and thus close to \([1,0]\) and the zero matrix \(0_{2}\), respectively. Since this example is known to be invariant in the position \(s\), the momentum \(p_{s}\) is conserved, which leads to a constant \(p_{s}\) for each trajectory. In Figure 1 it can be seen that the momentum \(p_{s}\) for the BaseNN and the HNN are not conserved, whereas the momentum for our proposed SymHNN is preserved effectively. To confirm this, the values for \(\ell_{\mathrm{sym}}^{(k)}\) are computed with \(v^{*}\) and 1000 randomly sampled grid points (in

Figure 1: Computed trajectories \(\gamma_{\theta}\) for different (learned) models for the cart-pendulum obtained with the implicit midpoint rule. Note: the exact trajectory is almost covered by \(\gamma_{\mathrm{SymHNN}}\).

Figure 4: Level sets of (learned) cart-pendulum Hamiltonian for constant values \((p_{s},p_{\varphi})=(0,0)\) on the left and \((s,\varphi)=(0,0)\) on the right. The gray box indicates the area where training examples are sampled.

Figure 3: Conserved quantity \(I\) (see (4)) evaluated for the pendulum on a cart states shown in Figure 1 and the learned Hamiltonian.

Figure 2: True cart-pendulum Hamiltonian (5) evaluated along the trajectories shown in Figure 1 shifted by \(H^{*}(\gamma_{\theta}(0))\).
an area, which is broader than the training data area). An improvement by a factor of 100 is observed (HNN: 3.1478 and SymHNN: 0.0136). The value for the SymHNN model with its learned value \(v_{SymHNN}\) is 0.0121, which indicates that the model preserves the learned symmetry slightly better than the true one.

However, since the integration in (8) is not performed exactly and the symmetry losses \(\ell_{\text{sym}}^{(k)}\) are not precisely zero, the conjugate momentum \(p_{s}\) is not exactly but only approximately conserved.

Figure 3 shows the conserved quantity (see Example II.2) evaluated for the trajectories shown in Figure 1 with the true symmetry \(v^{*}\) or the learned symmetry \(v_{\text{SymHNN}}\). \(I\) increases fast for the BaseNN model and oscillates and slightly drifts away for the HNN, whereas for the SymHNN it only slightly drifts away but has no high oscillations. The level sets of the Hamiltonian are shown in Figure 4 for constant values \((p_{s},p_{\phi})=(0,0)\) on the left and for \((s,\phi)=(0,0)\) on the right. As for BaseNN, no Hamiltonian is learned, it is not shown in this figure. The gray box indicates the area where data samples had been provided. The level sets inside the box match with the true ones rather well for both the HNN and the SymHNN model. Outside the gray box, both models start deviating from the true solution. Together with the trajectories from Figure 1, we conclude that conservation of \(p_{s}\) generalizes outside the range of provided data samples.

In Figure 5, the value of the invariant vector field is plotted for 1000 points. From the color scale it can be observed that, overall, the symmetry error is smaller for the SymHNN models than for HNN and the difference is even larger for the SymHNN with its own learned \(\widehat{v}_{\text{SymHNN}}\). For the SymHNN models a slight horizontal line pattern can be seen as the points exceed the training area, this again hints to the \(s\)-invariance of the system.

### Two-body example in cartesian coordinates

In order to generate data for the two-body example (Example II.4), points with a radius between 5 and 10 are sampled and the momentum \(p\) is constructed to be orthogonal to \(q\) with \(\|p\|=(1\pm 0.3)\left(\pm\sqrt{\frac{k}{\|q\|}}\right)\). Where \(\|p\|=\pm\sqrt{\frac{k}{\|q\|}}\) leads to perfect circular trajectories, i.e. solving the _vis viva_ equation (cf. Vallado, 2001).

5000 trajectories of 10 s length each are generated using

Figure 5: Median of \(\widehat{v}\) evaluated for 1000 randomly sampled cart-pendulum points (as for the training data but within a broader area), projected onto the \(q\)-plane. Note: the scaling of the colour bars differ.

Figure 6: Trajectories of different (learned) models for the cartesian two-body example.

Figure 7: True two-body Hamiltonian (7) evaluated for the states shown in Figure 6 shifted by \(H^{*}(\gamma_{\theta}(0))\).
a fourth-order Runge-Kutta method with a sampling rate of \(1\,\mathrm{Hz}\) and Gaussian noise with \(\sigma^{2}=1\mathrm{e}{-}2\) is added. The constructed data set is split into training (\(70\,\%\)), validation (\(15\,\%\)) and test data (\(15\,\%\)).

Figure 6 shows the longtime trajectories \(\gamma_{\theta}\) that are obtained using the learned models and integration by a implicit midpoint rule for the initial point \([7.0,0.0,1.72,12.05]\). None of the models can precisely map the true solution.

The true Hamiltonian \(H^{*}\), see (7), is evaluated along the trajectories from Figure 6 which is shown in Figure 7 (shifted by their inital value \(H^{*}(\gamma_{\theta}(0))\)). The Hamiltonian for the exact model oscillates with a small amplitude, due to the symplectic midpoint rule. This cannot be observed in Figure 7 as the amplitude is about \(\mathrm{e}{-}5\). The energy for the BaseNN drops directly, slightly swings up for the HNN and, besides the oscillations, stays at the same level for the SymHNN, even though the oscillations vary in magnitude.

The conserved quantities, recall (4), are shown in Figure 10 for the different combinations of trajectories and symmetries. The solid lines show the conserved quantity for the true symmetry, the dashed orange line shows the conserved quantity for the SymHNN trajectory with the learned symmetry and the dotted line shows the true trajectory with the learned symmetry \(v_{\mathrm{SymHNN}}\). The BaseNN and the HNN are not capable of conserving \(I\), whereas for SymHNN the conserved quantity oscillates. The orange dotted line indicates how much the leaned symmetry is respected by the true trajectory, which only oscillates with a small amplitude.

The projection from the trajectories from Figure 6 onto the \((x,y)\)-plane are shown in Figure 8. The exact system is completely integrable, i.e. the degrees of freedom equate to the number of independent, commuting conserved quantities. Compact level sets of the conserved quantities form topological tori (Liouville tori) and Hamiltonian motions are quasi-periodic motions on these tori (Libermann and Marle, 1987). The regularity in the plots corresponding to HNN and SymHNN suggest that the motions of these models are (almost) quasi-periodic motions on some modified tori in the

Figure 8: Two-body states shown in Figure 6 projected on \((x,y)\)-plane.

Figure 10: Conserved quantity \(I\) (see (4)) evaluated for states of the two-body example shown in Figure 6.

Figure 9: \(\hat{v}\) of the two-body example evaluated for 1000 samples and projected on the q-plane. In the upper row the exact symmetry \(v^{*}\) is chosen and in the lower the learned symmetry \(v_{\theta}\) is used. The left figures evaluate the HNN model and the right the SymHNN model.
phase space. This suggests that a completely integrable structure is approximately present in the learned models. In contrast, the unstructured motions exhibited by BaseNN appear not to follow a completely integrable dynamics.

In Figure 9, the values of \(\widehat{v}_{(q,p)}(H_{\theta})\) are shown for 1000 randomly sampled pairs of \((q,p)\) projected on the \((x,y)\)-plane. The samples are taken from the a slightly broader area than for the training examples. \(\widehat{v}_{(q,p)}\) vanishes, if \(H\) fulfills the symmetry given by \(v\). The middle figure compared to the left one indicates that the symmetry is better conserved by the SymHNN as not so many samples with high \(\widehat{v}_{(q,p)}\)-values are present. Furthermore, the values in the right figure are even smaller, indicating that the SymHNN model preserves the learned symmetry the best.

Figure 12 confirms this result. It shows the kernel density, median and quartiles for the same points as in Figure 9, compared for the different models. The violin on the right is the smallest, meaning the learned symmetry is approximately preserved from the SymHNN model.

The level sets of the (learned) Hamiltonian are shown in Figure 11 for different constant values for the coordinates. The two figures in the middle show that the level sets for \((p_{x},p_{y})=(0,0)\) and for \((x,y)=(3,3)\) are approximated quite precisely by either the HNN and the SymHNN. The four other images at the border (further away from the training data) show that the HNN has more difficulties to map accurately.

## V Conclusion and Future Work

We propose a neural network approach for simultaneously learning a system's Hamiltonian and its symmetries based on snapshot data. To preserve the symplectic structure encoded in the data, the NN is trained to learn the Hamiltonian, since the vector field can then be generated via automatic differentiation (cf. Greydanus, Dzamba, and Yosinski, 2019; Dierkes and Flasskamp, 2021). Extending this approach, known as the HNN method, we simultaneously identify inherent symmetries. For this, we make an ansatz for a symplectic Lie-group action on the phase space (e.g. affine linear transformations) and identify a subgroup whose actions leave the Hamiltonian invariant. The identified symmetries then correspond to conserved quantities of the Hamiltonian motion, such as conserved momentum in the studied cart-pendulum example.

The presented numerical examples demonstrate that the proposed framework is capable of learning a Hamiltonian and to identify symmetries of the system. Moreover, incorporation of the learned symmetries into the learned model improves qualitative aspects of the predicted motions.

A discrete-time variant of this approach might directly learn

Figure 11: Level sets of the different learned two-body Hamiltonian for fixed values for some coordinates (as indicated by the respective titles).

Figure 12: Mean and quartiles for the values of \(\tilde{v}\) shown in Figure 9.
modified Hamiltonian and discrete-time symmetries (cf. Offen and Ober-Blobaum, 2022; Ober-Blobaum and Offen, 2022). Symmetry in Hamiltonian systems give rise to relative equilibria, to which the learning framework can be extended in future.

###### Acknowledgements.

 E. Dierkes acknowledges funding by the Deutsche Forschungsgemeinschaft (DFG) Project number 281474342. C. Offen acknowledges the Ministerium fur Kultur und Wissenschaft des Landes Nordrhein-Westfalen.
